Sorry if this is an ignorant question, but I looked through and searched the forums but can´t find the answer. Has someone already coded the ability to restrict registrations to a single domain name. I want to restrict registrations so the email addresses that are given must come from a particular university. Any ideas?
That's one way to do things, but I don't think it's currently available. There is a mod to set up admin approval of registration.
edit register.php, findif (!eregi("^[_\.0-9a-z\-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,6}$", $email)) $error .= '<li>' . $lang_register_php['err_invalid_email'];
and add after it (in a new line)if (strstr($email,'@') != '@your.domain.tld') $error .= '<li>You need to register with an email address from your.domain.tld';
(modify your.domain.tld accordingly). Make sure to tell people in advance that they need an email address from "your.domain.tld", e.g. by modifying the registration agreement (to be found in lang/yourlanguage.php, in most cases lang/english.php, search for "$lang_register_disclamer" and edit accordingly). Upload all modified files to your server and you're done.
Joachim
What if I want to limit registration to two websites? People I want to allow can have either an @salisbury.edu or @students.salisbury.edu address. Do I just use the code provided twice? I'm new, but learning quickly with PHP and SQL
Tryif (strstr($email,'@') != '@your.domain.tld' && strstr($email,'@') != '@yet.another.domain.tld') {
$error .= '<li>You need to register with an email address from your.domain.tld or yet.another.domain.tld';
}