Found this code for blocking email domains by adding an array (in an old post), but it's not working, what did I do wrong ?
function check_email ( $uemail ) {
global $control, $error;
if ( ! strlen ( $uemail ) ) {
$error = translate ( 'Email address cannot be blank.' );
return false;
}
***********************************************************
$banned = array(
'21cn',
'tom',
'siteposter', );
foreach($banned as $ban){
if (strpos(strtolower($uemail), "@$ban.")){
$error .= '<li>' . 'Registration not permitted from these email providers.';
return false;
}
**********************************************************
$res = dbi_execute ( 'SELECT cal_email FROM webcal_user WHERE cal_email = ?',
array ( $uemail ) );
if ( $res ) { $row = dbi_fetch_row ( $res );
if ( $row[0] == $uemail ) {
$control = '';
$error = translate ( 'Email address already exists.' );
return false;
}
}
return true;
}
Added code between ....... ************ 's
Please post a link to your gallery as per board rules (http://forum.coppermine-gallery.net/index.php/topic,55415.msg270616.html#msg270616).
As well, please post the link to the topic in which you make reference.
As per the solution posted in the 1.5 plugins subforum:
Quote from: ΑndrĂ© on June 22, 2010, 04:13:44 PM
In register.php, find
if (!Inspekt::isEmail($email)) {
$error .= '<li style="list-style-image:url(images/icons/stop.png)">' . $lang_register_php['email_warning2'] . '</li>';
}
and after it add your preferred solution
Thanks TeraS
Is this topic solved? If not, try to replace your code with this one:
$banned = array(
'21cn',
'tom',
'siteposter'
);
foreach($banned as $ban) {
if (strpos(strtolower($uemail), "@$ban.")) {
$error .= '<li>' . 'Registration not permitted from these email providers.';
return false;
}
}