Changeset 4249 for extensions/NBC_UserAdvManager/trunk/main.inc.php
- Timestamp:
- Nov 11, 2009, 3:26:30 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/NBC_UserAdvManager/trunk/main.inc.php
r4234 r4249 2 2 /* 3 3 Plugin Name: NBC UserAdvManager 4 Version: 2.12. 54 Version: 2.12.6 5 5 Description: Renforcer les possibilités de gestion des utilisateurs - Enforce users management 6 6 Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=216 … … 96 96 Adding DE, ES and IT languages. All translations are not finalized and could be improved. 97 97 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 98 101 */ 99 102 … … 262 265 return l10n('reg_err_login5'); 263 266 } 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 = ' 285 select count(*) 286 from '.USERS_TABLE.' 287 where 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 = ' 280 312 select count(*) 281 313 from '.USERS_TABLE.' 282 314 where 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 } 287 320 } 288 321 }
Note: See TracChangeset
for help on using the changeset viewer.