Advanced search  

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

Pages: [1]   Go Down

Author Topic: Restricting access to registration  (Read 6978 times)

0 Members and 1 Guest are viewing this topic.

brandoncolorado

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Restricting access to registration
« 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?
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Restricting access to registration
« Reply #1 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.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Restricting access to registration
« Reply #2 on: April 06, 2005, 07:32:10 am »

edit register.php, find
Code: [Select]
if (!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)
Code: [Select]
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
Logged

suphotos

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Restricting access to registration
« Reply #3 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
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Restricting access to registration
« Reply #4 on: May 02, 2005, 09:03:47 am »

Try
Code: [Select]
if (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';
}
Logged
Pages: [1]   Go Up
 

Page created in 0.316 seconds with 19 queries.