pjohn323 Posted June 30, 2010 Share Posted June 30, 2010 Calendar does not provide for IP discovery nor specific email blocking. I am getting bombed with Spammers, The code below is my attempt to prevent certain email domains from registering. What am I doing wrong (red is my code edit) Calendar register.php 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; } Link to comment https://forums.phpfreaks.com/topic/206324-calendar-email-ban-help/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.