Changeset 4415 for extensions/NBC_UserAdvManager/trunk/main.inc.php
- Timestamp:
- Dec 3, 2009, 6:49:56 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/NBC_UserAdvManager/trunk/main.inc.php
r4384 r4415 2 2 /* 3 3 Plugin Name: NBC UserAdvManager 4 Version: 2.13. 04 Version: 2.13.1 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 … … 174 174 { 175 175 return l10n('reg_err_login5'); 176 } 177 178 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*/ 179 { 180 /* Email doblons check */ 181 $atom = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]'; // before arobase 182 $domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; // domain name 183 $regex = '/^' . $atom . '+' . '(\.' . $atom . '+)*' . '@' . '(' . $domain . '{1,63}\.)+' . $domain . '{2,63}$/i'; 184 185 if (!preg_match($regex, $_POST['email'])) 186 { 187 return l10n('reg_err_mail_address'); 188 } 189 190 $query = ' 191 SELECT count(*) 192 FROM '.USERS_TABLE.' 193 WHERE upper('.$conf['user_fields']['email'].') = upper(\''.$_POST['email'].'\') 194 ;'; 195 list($count) = mysql_fetch_array(pwg_query($query)); 196 if ($count != 0) 197 { 198 return l10n('reg_err_mail_address_dbl'); 199 } 200 } 201 202 if (script_basename() == 'register') /* not the same email variable if we are on users registration page or on admin's user registration page*/ 203 { 204 /* Email doblons check */ 205 $atom = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]'; // before arobase 206 $domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; // domain name 207 $regex = '/^' . $atom . '+' . '(\.' . $atom . '+)*' . '@' . '(' . $domain . '{1,63}\.)+' . $domain . '{2,63}$/i'; 208 209 if (!preg_match($regex, $_POST['mail_address'])) 210 { 211 return l10n('reg_err_mail_address'); 212 } 213 214 $query = ' 215 SELECT count(*) 216 FROM '.USERS_TABLE.' 217 WHERE upper('.$conf['user_fields']['email'].') = upper(\''.$_POST['mail_address'].'\') 218 ;'; 219 list($count) = mysql_fetch_array(pwg_query($query)); 220 if ($count != 0) 221 { 222 return l10n('reg_err_mail_address_dbl'); 223 } 176 224 } 177 225 /* ****************************************** */
Note: See TracChangeset
for help on using the changeset viewer.