Restricting access to registration Restricting access to registration
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Restricting access to registration

Started by brandoncolorado, April 05, 2005, 03:35:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

brandoncolorado

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?

Tranz

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.

Joachim Müller

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

suphotos

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

Joachim Müller

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';
}