Customizing SMF > Now Available

Do not allow certain email domains w/o having to use ban

<< < (2/2)

[Unknown]:
Sources/Register.php, find:


--- Code: --- if (empty($_POST['email']) || preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]+@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', stripslashes($_POST['email'])) == 0)
fatal_error(sprintf($txt[500], $_POST['user']), false);
--- End code ---

Add below:

--- Code: --- if (preg_match('~@(hotmail\.com|aol\.com|yahoo\.com|gmail\.com|engineer\.com|mail\.com|otherwebmailsite\.org)$~', $_POST['email']))
fatal_error('Sorry, but you cannot register here with a webmail/free email account.  Please choose a different email address, and remember that you can choose to keep your email hidden.', false);
--- End code ---

This doesn't fix it everywhere, but it's better than nothing, no? (I'd put this in and then KEEP the ban... see?)

-[Unknown]

Ride:
It'd be nice to have an interface in the admin to do this.  Who's up for making a mod?   ;)

Ride:
Can somebody come up with a way to have the script check a text file for email domains that aren't allowed?  This would be easier than going into the code each time I needed to add a domain.  Thanks!!

Navigation

[0] Message Index

[*] Previous page

Go to full version