Ignore:
Timestamp:
Dec 3, 2009, 6:49:56 PM (14 years ago)
Author:
Eric
Message:

[NBC_UserAdvManager]

  • Bug 1302 fixed : Re-coded double email check on registration.
  • Bug 1304 fixed : Adding of plugin version in plugin admin panel title.
File:
1 edited

Legend:

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

    r4384 r4415  
    22/*
    33Plugin Name: NBC UserAdvManager
    4 Version: 2.13.0
     4Version: 2.13.1
    55Description: Renforcer les possibilités de gestion des utilisateurs - Enforce users management
    66Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=216
     
    174174  {
    175175    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 = '
     191SELECT count(*)
     192FROM '.USERS_TABLE.'
     193WHERE 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 = '
     215SELECT count(*)
     216FROM '.USERS_TABLE.'
     217WHERE 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    }
    176224  }
    177225/* ****************************************** */
Note: See TracChangeset for help on using the changeset viewer.