Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: registration criteria  (Read 3578 times)

0 Members and 1 Guest are viewing this topic.

mich

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
registration criteria
« on: November 02, 2003, 03:47:03 pm »

i would like to limit the registration process to only person with a email of our organization, say "xxx@mycompany.com".
Can any one tell me how to do this?
thanks in advance.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
registration criteria
« Reply #1 on: November 02, 2003, 08:03:40 pm »

edit register.php and 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']; Add after it something like
Code: [Select]
if (strstr($email, '@') !="foobar.com")
{
error .= 'Only users of foobar.com are allowed to register';
}

Note that I haven't tested this, but something along these lines should work...

GauGau

P.S. next time you post a support request, please do so on the proper support board, not in "General discussion". I moved your thread to 1.2.0 support, because I don't know what version you're running
Logged

mich

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
not work
« Reply #2 on: November 03, 2003, 09:30:15 am »

i got a blank page after adding the code. Could anyone help me??
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
registration criteria
« Reply #3 on: November 03, 2003, 09:33:27 am »

link?

GauGau
Logged

mich

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
registration criteria
« Reply #4 on: November 03, 2003, 03:02:34 pm »

i have tried to remove the code added, then it became ok again...

http://218.190.83.184/

the code being added like:
    if (strlen($user_name) < 2) $error .= '<li>' . $lang_register_php['err_uname_short'];
    if (strlen($password) < 2) $error .= '<li>' . $lang_register_php['err_password_short'];
    if ($password == $user_name) $error .= '<li>' . $lang_register_php['err_uname_pass_diff'];
    if ($password != $password_again) $error .= '<li>' . $lang_register_php['err_password_mismatch'];

    if (!eregi("^[_\.0-9a-z\-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,6}$", $email)) $error .= '<li>' . $lang_register_php['err_invalid_email'];

if (strstr($email, '@') !="foobar.com")
{
error .= 'Only users of foobar.com are allowed to register';
}

    if ($error != '') return false;

    if (!$CONFIG['allow_duplicate_emails_addr']) {
        $sql = "SELECT user_id " . "FROM {$CONFIG['TABLE_USERS']} " . "WHERE user_email = '" . addslashes($email) . "'";
        $result = db_query($sql);
Logged
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 20 queries.