Ignore:
Timestamp:
Oct 6, 2007, 8:41:18 AM (17 years ago)
Author:
rub
Message:

Resolved 0000759: email unique for each user

Fix bug of last commit 2115

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions_user.inc.php

    r2115 r2124  
    3434// If the mail address doesn't correspond, an error message is returned.
    3535//
    36 function validate_mail_address($mail_address)
     36function validate_mail_address($user_id, $mail_address)
    3737{
    3838  global $conf;
    3939
    4040  if (empty($mail_address) and
    41       !($conf['obligatory_user_mail_address'] and in_array(script_basename(), array('register', 'profile'))))
     41      !($conf['obligatory_user_mail_address'] and
     42      in_array(script_basename(), array('register', 'profile'))))
    4243  {
    4344    return '';
     
    5657from '.USERS_TABLE.'
    5758where upper('.$conf['user_fields']['email'].') = upper(\''.$mail_address.'\')
     59'.(is_numeric($user_id) ? 'and '.$conf['user_fields']['id'].' != \''.$user_id.'\'' : '').'
    5860;';
    5961    list($count) = mysql_fetch_array(pwg_query($query));
     
    8587    array_push($errors, l10n('reg_err_login5'));
    8688  }
    87   $mail_error = validate_mail_address($mail_address);
     89  $mail_error = validate_mail_address(null, $mail_address);
    8890  if ('' != $mail_error)
    8991  {
Note: See TracChangeset for help on using the changeset viewer.