Your E-Mail Address *

Discussion in 'Customization & add-ons' started by sunithbabu, Mar 17, 2011.

  1. sunithbabu

    sunithbabu New Member

    Joined:
    Mar 10, 2011
    Messages:
    8
    Hi,

    I'm setting up a moodle site where in users with EDU or edu associated subdomains only can register on the site and if any one else with different email ID like gmail.com / rediffmail.com / yahoo.com register, the amember should not allow to register.

    Can any one help me in this regard to allow only edu registrations.

    Also I need to enter below on the site where you enter Your E-Mail Address *
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    To change email field title and description you should edit /amember/language/en.php :
    PHP:
    define ('_TPL_SIGNUP_EMAIL''Your E-Mail Address');
    define ('_TPL_SIGNUP_EMAIL_1''A confirmation email will be sent');
    define ('_TPL_SIGNUP_EMAIL_2''to you at this address');
    Then add this code to /amember/site.inc.php:
    PHP:
    <?php 
    setup_plugin_hook
    ("validate_signup_form""check_edu_email"); 
    function 
    check_edu_email($vars){
    if(!
    preg_match("/\.edu$/"$vars[email]))
    $errors[] = "We allow to signup only from .edu emails";
    return 
    $errors;

    }

    ?>
  3. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    Hmm.. this sounds like a good opportunity for a plugin :)

    I'll add it to the list and release a free plugin that does this as well in a few weeks that will add an admin config to allow or reject specified domains.

Share This Page