Support Forum Project Downloads FAQ Documentation About Demo Tutorials Blog Plugins
November 20, 2009, 10:59:12 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Maintenance release cpg1.4.25 - upgrade recommended
The Coppermine development team is releasing an update for Coppermine in order to fix an issue with http uploads that could occur in particular versions of PHP.The fix is not security-critical, so if your gallery is running fine with cpg1.4.23 or cpg1.4.24 you don't need to upgrade. If you are running an older version than cpg1.4.23, you must update to this latest version as soon as possible because of the security impact (the past few maintenance releases before cpg1.4.24 all were security-related).
[more]
   Home   Help Search Board rules Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: how to ban aol addresses  (Read 4383 times)
0 Members and 1 Guest are viewing this topic.
TranzNDance Topic starter
Dev Team member
****
Gender: Female
United States United States

Posts: 6138



WWW
« on: September 12, 2004, 01:55:31 pm »

One of the issues we have at my web host is that webadmins get into trouble when AOL users abuse or misuse the Report As Spam button even though they subscribe to such things as forum notifications. So we ban aol addresses from subscribing to our forums. I figured it would be wise not to allow people to send my gallery ecards to aol addresses for the same reason. I modified my code, which you can see in action at my gallery. If you don't have an aol address to test with, you can use the one that I tested with: testtoseeifscriptbansaoladdress2004-09-12@aol.com

2 files to edit:
lang/english.php (or other language file if you want)
ecard.php

In lang/english.php
FIND
Code:
if (defined('ECARDS_PHP') || defined('DISPLAYECARD_PHP')) $lang_ecard_php =array(

ADD
Code:
'aol_sucks' => ': AOL addresses not allowed due to abuse of spam reporting function and AOL\'s ridiculous policies.',

+++++++++++++++++++++++++++++

FIND
Code:
'rcpt_email' => 'Recipient email address',

REPLACE WITH
Code:
'rcpt_email' => 'Recipient email address <br>(aol addresses not allowed)',

+++++++++++++++++++++++++++++

in ecard.php
FIND
Code:
$recipient_email_warning = '';

ADD
Code:
$recipient_aol_warning = '';

+++++++++++++++++++++++++++++

FIND
Code:
$valid_email_pattern = "^[_\.0-9a-z\-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,6}$";
$valid_sender_email = eregi($valid_email_pattern, $sender_email);
$valid_recipient_email = eregi($valid_email_pattern, $recipient_email);
$invalid_email = '<font size="1">' . $lang_ecard_php['invalid_email'] . '</font>';
if (!$valid_sender_email && count($HTTP_POST_VARS) > 0) $sender_email_warning = $invalid_email;
if (!$valid_recipient_email && count($HTTP_POST_VARS) > 0) $recipient_email_warning = $invalid_email;

REPLACE WITH
Code:
$valid_email_pattern = "^[_\.0-9a-z\-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,6}$";
$valid_sender_email = eregi($valid_email_pattern, $sender_email);
$recipient_email_aol = eregi('aol.com', $recipient_email);
$valid_recipient_email = eregi($valid_email_pattern, $recipient_email) && !$recipient_email_aol;
$invalid_email = '<font size="1" color="red">' . $lang_ecard_php['invalid_email'] . ' (' . $recipient_email . ')</font>';
$aol_sucks = '<font size="1">' . $lang_ecard_php['aol_sucks'] . '</font>';
if (!$valid_sender_email && count($HTTP_POST_VARS) > 0) $sender_email_warning = $invalid_email;
if (!$valid_recipient_email && count($HTTP_POST_VARS) > 0) $recipient_email_warning = $invalid_email;
if ($recipient_email_aol && count($HTTP_POST_VARS) > 0) $recipient_aol_warning = $aol_sucks;

+++++++++++++++++++++++++++++

FIND
Code:
<td valign="top" class="tableb" width="60%">
                        <input type="text" class="textinput" name="recipient_email"  value="$recipient_email" style="WIDTH: 100%;"><br />
                        $recipient_email_warning
                </td>

REPLACE WITH
Code:
<td valign="top" class="tableb" width="60%">
                        <input type="text" class="textinput" name="recipient_email"  value="$recipient_email" style="WIDTH: 100%;"><br />
                        $recipient_email_warning $recipient_aol_warning
                </td>

This code likely could be modified so it's configurable to be disabled/enabled with any domain that the admin wants. However, that would take time and effort that might not be worth for me to figure out if the demand for this feature isn't high enough.
« Last Edit: September 12, 2004, 02:46:16 pm by GauGau » Logged

Joachim Müller
Administrator
*****
Gender: Male
Germany Germany

Posts: 45046


aka "GauGau"


WWW
« Reply #1 on: September 19, 2006, 11:24:18 pm »

Thread moved from Mods: Emails/Notifications to the mods board that contains outdated mods.
This mod has originally been created for cpg1.3.x, which goes unsupported from the end of September 2006 on. If you're trying to port this mod to a newer version, you're welcome to try, but please don't ask questions on it. If you have accomplished porting it, start a new thread on the support board, with reference to this thread. A moderator will move your thread accordingly if applicable.

Joachim
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC
Page created in 0.057 seconds with 16 queries.