Ignore:
Timestamp:
11/11/09 15:26:30 (10 years ago)
Author:
Eric
Message:

[NBC_UserAdvManager]

  • Bug 1236 fixed : Admins couldn't add new users accounts in admin panel.
  • Beginning of IT translation
  • Some language files corrections
File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/NBC_UserAdvManager/trunk/main.inc.php

    r4234 r4249  
    22/* 
    33Plugin Name: NBC UserAdvManager 
    4 Version: 2.12.5 
     4Version: 2.12.6 
    55Description: Renforcer les possibilités de gestion des utilisateurs - Enforce users management 
    66Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=216 
     
    9696            Adding DE, ES and IT languages. All translations are not finalized and could be improved. 
    9797            Adding of description.txt file in language directories. 
     98 
     99-- 2.12.6 : Bug 1236 fixed -  Admins was unable to add a new user in the user_list page. 
     100            Beginning of IT translations 
    98101*/ 
    99102 
     
    262265    return l10n('reg_err_login5'); 
    263266  } 
    264    
    265   /* ***************************** */ 
    266   /* Standard Piwigo's email check */ 
    267   /* ***************************** */ 
    268   $atom   = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]';   // before  arobase 
    269   $domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; // domain name 
    270   $regex = '/^' . $atom . '+' . '(\.' . $atom . '+)*' . '@' . '(' . $domain . '{1,63}\.)+' . $domain . '{2,63}$/i'; 
    271  
    272   if (!preg_match($regex, $_POST['mail_address'])) 
    273   { 
    274     return l10n('reg_err_mail_address'); 
    275   } 
    276  
    277   if (!empty($_POST['mail_address'])) 
    278   { 
    279     $query = ' 
     267 
     268  if (script_basename() == 'admin' and isset($_GET['page']) and $_GET['page'] == 'user_list') /* not the same email variable if we are on users registration page or on admin's user registration page*/ 
     269  { 
     270    /* ***************************** */ 
     271    /* Standard Piwigo's email check */ 
     272    /* ***************************** */ 
     273    $atom   = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]';   // before  arobase 
     274    $domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; // domain name 
     275    $regex = '/^' . $atom . '+' . '(\.' . $atom . '+)*' . '@' . '(' . $domain . '{1,63}\.)+' . $domain . '{2,63}$/i'; 
     276   
     277    if (!preg_match($regex, $_POST['email'])) 
     278    { 
     279      return l10n('reg_err_mail_address'); 
     280    } 
     281     
     282    if (!empty($_POST['email'])) 
     283    { 
     284      $query = ' 
     285select count(*) 
     286from '.USERS_TABLE.' 
     287where upper('.$conf['user_fields']['email'].') = upper(\''.$_POST['email'].'\');'; 
     288      list($count) = mysql_fetch_array(pwg_query($query)); 
     289      if ($count != 0) 
     290      { 
     291        return l10n('reg_err_mail_address_dbl'); 
     292      } 
     293    } 
     294  } 
     295  else 
     296  { 
     297    /* ***************************** */ 
     298    /* Standard Piwigo's email check */ 
     299    /* ***************************** */ 
     300    $atom   = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]';   // before  arobase 
     301    $domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; // domain name 
     302    $regex = '/^' . $atom . '+' . '(\.' . $atom . '+)*' . '@' . '(' . $domain . '{1,63}\.)+' . $domain . '{2,63}$/i'; 
     303 
     304    if (!preg_match($regex, $_POST['mail_address'])) 
     305    { 
     306      return l10n('reg_err_mail_address'); 
     307    } 
     308     
     309    if (!empty($_POST['mail_address'])) 
     310    { 
     311      $query = ' 
    280312select count(*) 
    281313from '.USERS_TABLE.' 
    282314where upper('.$conf['user_fields']['email'].') = upper(\''.$_POST['mail_address'].'\');'; 
    283     list($count) = mysql_fetch_array(pwg_query($query)); 
    284     if ($count != 0) 
    285     { 
    286       return l10n('reg_err_mail_address_dbl'); 
     315      list($count) = mysql_fetch_array(pwg_query($query)); 
     316      if ($count != 0) 
     317      { 
     318        return l10n('reg_err_mail_address_dbl'); 
     319      } 
    287320    } 
    288321  } 
Note: See TracChangeset for help on using the changeset viewer.