I found out that many spam bots are registering on my site with domain such as mail.ru, nlist.ru etc.
So I decided to disable new registration from those domains and here is small mod that will do that:
1. Add new row in 4images_settings table:
ALTER TABLE 4images_settings
ADD bad_mail
2. Open /includes/functions.php and before
?>
add
function mailCheck($user_email) {
global $site_db, $config;
$user_email = strtolower($user_email);
$return = 'true';
if ($config['bad_mail'] > '') {
$BadMailList = explode("\r\n", $config['bad_mail']);
$j = count($BadMailList);
for ($i = 0;$i < $j;++$i) {
if (eregi($BadMailList[$i], $user_email)) $return = 'false';
}
}
return $return;
}
3. Open register.php and before
if ($user_password == "") {
add
if (mailCheck($user_email) == "false") {
$msg .= (($msg != "") ? "<br />" : "").$lang['invalid_email_format'];
$error = 1;
}
4. Open admin/settings.php and after:
show_setting_row("highlight_admin", "radio");
add
show_setting_row("bad_mail", "textarea");
Now you can in admin settings add bad domain names that you want to banned from registration; one after another.
Example:
aravensoft.com
bk.ru
list.ru
mail.ru
mysite.com
ya.ru
yoursite.com
You are welcome to test this mod first and add you suggestion how to improve it.
Enjoy!