4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: Lucifix on July 10, 2009, 01:16:52 PM
-
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!
-
very nice!
Thank you!
-
Glad that you like it.
Can you confirm if it's working correct?
-
Hi,
it's working fine for me.
The only thing I found is you forgot the language entry:
Open /lang/your_language/admin.php and find:
?>
BEFORE add:
$setting['bad_mail'] = "Zu blockierende Mail Hosts eingeben:";
If you don't add this there is a empty textfield at admin settings only.
Just a correction to make it looking better ;-)
And I made a list with the most famous trashmail pages:
trash-mail.com
trash-mail.de
spambog.com
spambog.de
discardmail.com
discardmail.de
spambog.ru
cust.in
imails.info
great-host.in
teewars.org
kulturbetrieb.info
bio-muesli.net
bio-muesli.info
0815.ru
sandelf.de
recode.me
3d-painting.com
nomail2me.com
sofort-mail.de
dodgit.com
mailinator.com
jetable.org
spam.la
mt2009.com
trash2009.com
trashymail.com
mytrashmail.com
e4ward.com
kasmail.com
iximail.com
kas-group.com
spamgourmet.com
eintagsmail.de
hidemail.de
emailto.de
-
denying email adresses based on domain name is a bad practice...