coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Permissions & Access Rights => Topic started by: brandoncolorado on April 05, 2005, 03:35:50 PM

Title: Restricting access to registration
Post by: brandoncolorado on April 05, 2005, 03:35:50 PM
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?
Title: Re: Restricting access to registration
Post by: Tranz on April 05, 2005, 04:11:01 PM
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.
Title: Re: Restricting access to registration
Post by: Joachim Müller on April 06, 2005, 07:32:10 AM
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
Title: Re: Restricting access to registration
Post by: suphotos on May 02, 2005, 08:59:57 AM
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
Title: Re: Restricting access to registration
Post by: Joachim Müller on May 02, 2005, 09:03:47 AM
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';
}