Results 1 to 9 of 9

Thread: Restrict user email on registration

  1. #1
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default Restrict user email on registration

    I'd like to see a feature where the administrator can restrict certain email domains from being used when people register, in the same fashion that administrators of bulletin boards have. You can put in a particular address or an entire domain like *@yahoo.com or *@hotmail.com, etc.

    One I'd like to block in particular is Yahoo! because they are overly paranoid. They tend to block a lot of legitimate emails and then you have to jump through all kinds of hoops to get them to unblock you.

    Well, I got enough to do than jump through their hoops. I need to restrict the use of yahoo.com addresses from registration. I don't want to block users who are already signed up and using yahoo, I just want to block future registrations, since that is the email that their new account details and the activation link is sent to.

    Thanks.
    If it's not fun, stop doing it!

  2. #2

    Default

    Code:
     $email = $_POST['email'];
    $email = parse_url($email);
    $email = $email['host']
    
    if ($email == "yahoo.com" || $email == "hotmail.com"){
    
    echo "The administrator has chosen not to accept email addresses from Yahoo and Hotmail";
    
    echo "<a href=\"javascript:history.go(-1);\">
        <b><font size=\"2\">&lt;&lt; Previous page</font></b></a>";
    exit();
    }
    Last edited by carefree2; 05-20-2009 at 07:23 AM.

  3. #3
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default

    Yes, something like that except maybe with an alert dialogue that pops up when they hit submit: "Email addresses from this domain are restricted. Please use an alternate email address" (some similar wording) that they have to click "ok" to.

    ...and a spot in admin panel were the administrator can enter in the domains he/she wants to "ban" from registration (like they have in most forum admin panels).
    If it's not fun, stop doing it!

  4. #4

    Default

    Quote Originally Posted by grynmoors View Post
    Yes, something like that except maybe with an alert dialogue that pops up when they hit submit: "Email addresses from this domain are restricted. Please use an alternate email address" (some similar wording) that they have to click "ok" to.

    ...and a spot in admin panel were the administrator can enter in the domains he/she wants to "ban" from registration (like they have in most forum admin panels).

    I try to avoid too much javascript, direct code is much faster

    You can add a column to the config table with stored emails then use this script to check it

    A better way for all these mods is to write an autoinstaller like phpbb has, that way ppl can pick and choose what goes in and stays out.



  5. #5
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default

    Mod installer: Great idea, post it as feature request (if you haven't already).
    If it's not fun, stop doing it!

  6. #6

    Default

    Quote Originally Posted by grynmoors View Post
    Mod installer: Great idea, post it as feature request (if you haven't already).
    Yeah right, as if they will listen. Think its up to us to do it

  7. #7
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default

    Oh ye of little faith.... LOL

    I have seen quite a few of the ideas and suggestions posted to the board become a reality. For ones off the top of my head: the users profile picture, the url in their profile/video description and some other stuff.

    Some have been included in their next releases and some we had to wait a while for, but they did happen eventually.
    If it's not fun, stop doing it!

  8. #8
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default

    OK here's another thought. I would still like to see an alert box since most peeps have their java turned on (don't they need it on for vShare to work? I'll have to check that....) [EDIT: They need it if they want to be able to post comments]

    It was brought to my attention that using Java would make bypassing the check easy if a person has it turned off...so....how about including something that if their java is turned off, they will still see the message...something along these lines which I found at dynamic drive forums (this is for when the email is already taken, but it gives you an idea of what I'm talking about):

    Code:
    ?> 
      <script type="text/javascript"> 
        alert("The email address <?php echo $_POST['email']; ?> is already registered."); 
        history.back(); 
      </script> 
    <?php 
    //THIS CODE IS UNCOMMENTED 
    //So that people without JS can still see the message. 
            die("The email address '" . $_POST['email'] ."' is already registered"); 
    //END 
            //print '<script type="text/javascript">'; 
            //print 'alert("The email address ' . $_POST['email'] .' is already registered")'; 
            //print '</script>'; 
    
        } 
    Last edited by grynmoors; 05-20-2009 at 04:34 PM.
    If it's not fun, stop doing it!

  9. #9
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default

    Oh here's another thought...enabling a <div> that the email they tried to use is restricted...

    [edit] Never mind...I think an alert box would be better 'cos it's more "in your face"
    Last edited by grynmoors; 05-20-2009 at 03:39 PM.
    If it's not fun, stop doing it!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •