Advertisement:

Author Topic: Do not allow certain email domains w/o having to use ban  (Read 37833 times)

Offline Ride

  • Jr. Member
  • **
  • Posts: 185
  • Gender: Male
    • Southern California Snowboarding Forum
Do not allow certain email domains w/o having to use ban
« on: August 27, 2004, 09:18:34 PM »
It be nice to have an area in admin to not allow certain email domains w/o having to use the ban area. 

Offline dschwab9

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,320
  • Gender: Male
    • Technology, Ministry and Other Ramblings
Re: Do not allow certain email domains w/o having to use ban
« Reply #1 on: August 28, 2004, 01:03:53 AM »
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.

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Do not allow certain email domains w/o having to use ban
« Reply #2 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]

Offline Elijah Bliss

  • Sophist Member
  • *****
  • Posts: 1,340
Re: Do not allow certain email domains w/o having to use ban
« Reply #3 on: August 28, 2004, 04:51:59 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.

Offline dschwab9

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,320
  • Gender: Male
    • Technology, Ministry and Other Ramblings
Re: Do not allow certain email domains w/o having to use ban
« Reply #4 on: August 28, 2004, 07:01:38 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  :-\

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Do not allow certain email domains w/o having to use ban
« Reply #5 on: August 28, 2004, 04:37:09 PM »
Sources/Register.php, find:

Code: [Select]
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:
Code: [Select]
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]

Offline Ride

  • Jr. Member
  • **
  • Posts: 185
  • Gender: Male
    • Southern California Snowboarding Forum
Re: Do not allow certain email domains w/o having to use ban
« Reply #6 on: August 29, 2004, 02:32:42 PM »
It'd be nice to have an interface in the admin to do this.  Who's up for making a mod?   ;)

Offline Ride

  • Jr. Member
  • **
  • Posts: 185
  • Gender: Male
    • Southern California Snowboarding Forum
Re: Do not allow certain email domains w/o having to use ban
« Reply #7 on: September 20, 2004, 11:17:57 PM »
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!!