• Welcome to Simple Machines Community Forum. Please login or sign up.
January 22, 2022, 07:34:04 AM

News:

Want to get involved in developing SMF, then why not lend a hand on our github!


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

Started by Ride, August 27, 2004, 09:18:34 PM

Previous topic - Next topic

Ride

It be nice to have an area in admin to not allow certain email domains w/o having to use the ban area. 

dschwab9

I agree.  A way to block hotmail/aol/etc without telling them "Sorry you are banned" and setting a cookie which locks them out forever.

[Unknown]

I suppose the "and not setting a cookie which locks them out forever" part does make it seem a little more neccessary...

-[Unknown]

Elijah Bliss

Quote from: dschwab9 on August 28, 2004, 01:03:53 AM
...and setting a cookie which locks them out forever.

This sounds excellent. I have this AOL troll that won't go away, the regular banning methods don't really work. Maybe making a cookie to redirect them to another site when they try to access your forum or something to that effect.

dschwab9

Quote from: [Unknown] on August 28, 2004, 02:30:37 AM
I suppose the "and not setting a cookie which locks them out forever" part does make it seem a little more neccessary...

-[Unknown]

Yeah.  If you're trying to keep out people with webmail accounts or something, you want to be able to politely tell them "That email domain is not allowed"  and allow them to enter a different one  :-\

[Unknown]

Sources/Register.php, find:

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);


Add below:
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);


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!!

Advertisement: