Changeset 7000 for extensions


Ignore:
Timestamp:
Sep 22, 2010, 5:25:06 PM (14 years ago)
Author:
Eric
Message:

Merge from Trunk to Branch 2.15

Location:
extensions/NBC_UserAdvManager/branches/2.15
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • extensions/NBC_UserAdvManager/branches/2.15/changelog.txt.php

    r6823 r7000  
    196196            Bug 1821 fixed - Cleanup of old deprecated functions slags (Case sensitivity on logins)
    197197            Bug 1834 fixed - Improving plugin installation and uninstallation process
     198
     199-- 2.15.7 : Bug 1869 fixed - Compatibility with Adult_Content installation process
    198200*/
    199201?>
  • extensions/NBC_UserAdvManager/branches/2.15/language/de_DE/help/plugin.lang.php

    r6823 r7000  
    3535Hinweis: Wenn der Benutzer erstellte Konto will Passwort zu ändern und Passwörter für die Benutzer Stärkung aktiv ist, wird es vorbehaltlich der Regel-Satz.';
    3636$lang['UAM_mailexcTitle'] = 'Ausschluss von Mail-Domänen';
    37 $lang['UAM_mailexcTitle_d'] = 'Standardmäßig akzeptiert Piwigo alle E-Mail-Adressen im Format xxx@yyy.zz. Durch die Aktivierung dieser Option können Sie auf bestimmte Domains im Format ausschließen: @[Domänenname].[Domain Extension].<br><br>
    38 Beispiele:<br>
    39 @hotmail.com -> Ausnahme-Adressen *@hotmail.com<br>
    40 @hotmail -> ohne alle Adressen *@hotmail *';
    4137$lang['UAM_infomailTitle'] = 'Informationen E-Mail an Benutzer';
    4238$lang['UAM_infomailTitle_d'] = 'Diese Option ermöglicht die Automatisierung Senden einer E-Mail-Informationen an einen Benutzer bei der Anmeldung oder bei Änderungen sein Passwort oder E-Mail-Adresse in ihrem Profil.<br><br>
     
    183179Bitte beachten Sie: Dieses Feature funktioniert nicht für alle registrierten Nutzer. Diejenigen mit &quot;admin&quot;, &quot;Webmaster&quot; oder &quot;Generic&quot; Status sind ausgeschlossen.';
    184180// --------- End: New or revised $lang ---- from version 2.15.6
     181
     182// --------- Starting below: New or revised $lang ---- from version 2.15.7
     183$lang['UAM_mailexcTitle_d'] = 'Standardmäßig akzeptiert Piwigo alle E-Mail-Adressen im Format xxx@yyy.zz. Durch die Aktivierung dieser Option können Sie auf bestimmte Domains im Format ausschließen: @[Domänenname].[Domain Extension].<br><br>
     184Beispiele:<br>
     185@hotmail.com -> Ausnahme-Adressen *@hotmail.com<br>
     186@hotmail -> ohne alle Adressen *@hotmail *
     187<br><br>
     188<b style=&quot;color: red;&quot;>Die Beschlagnahme ist nur möglich nach Eintragung der Option in der aktivierten Position.</b>';
     189// --------- End: New or revised $lang ---- from version 2.15.7
    185190?>
  • extensions/NBC_UserAdvManager/branches/2.15/language/en_UK/help/plugin.lang.php

    r6823 r7000  
    3535Note: If the user account created wants to change password and strengthening passwords for users is active, it will be subject to the rule set.';
    3636$lang['UAM_mailexcTitle'] = 'Exclusion of mail domains';
    37 $lang['UAM_mailexcTitle_d'] = 'By default, Piwigo accepts all email addresses in the format xxx@yyy.zz. Enabling this option allows you to exclude certain domains in the format: @ [domain_name].[domain_extension].<br><br>
    38 Examples :<br>
    39 @hotmail.com -> excluding addresses *@hotmail.com<br>
    40 @hotmail -> excluding all addresses *@hotmail*';
    4137$lang['UAM_infomailTitle'] = 'Information email to user';
    4238$lang['UAM_infomailTitle_d'] = 'This option allows to automate sending an information email to a user when registering or when changes his password or email address in their profile.<br><br>
     
    183179Please note: This feature does not apply to all registered users. Those with &quot;admin&quot;, &quot;webmaster&quot; or &quot;generic&quot; status are excluded.';
    184180// --------- End: New or revised $lang ---- from version 2.15.6
     181
     182// --------- Starting below: New or revised $lang ---- from version 2.15.7
     183$lang['UAM_mailexcTitle_d'] = 'By default, Piwigo accepts all email addresses in the format xxx@yyy.zz. Enabling this option allows you to exclude certain domains in the format: @ [domain_name].[domain_extension].<br><br>
     184Examples :<br>
     185@hotmail.com -> excluding addresses *@hotmail.com<br>
     186@hotmail -> excluding all addresses *@hotmail*
     187<br><br>
     188<b style=&quot;color: red;&quot;>The seizure is only possible after registration of the option in the activated position.</b>';
     189// --------- End: New or revised $lang ---- from version 2.15.7
    185190?>
  • extensions/NBC_UserAdvManager/branches/2.15/language/es_ES/help/plugin.lang.php

    r6823 r7000  
    3535Nota: Si el  usuario de la cuenta  creada quiere cambiar la contraseña, y el fortalecimiento de las contraseñas de los usuarios está activo, la misma estará sujeta a la norma establecida.';
    3636$lang['UAM_mailexcTitle'] = 'Exclusión de dominios de correo electrónico';
    37 $lang['UAM_mailexcTitle_d'] = 'De forma predeterminada, Piwigo acepta todas las direcciones de correo electrónico en el  formato xxx@yyy.zz. Al habilitar esta opción le permite excluir ciertos dominios en el formato: @[nombreDeDominio].[Domain_extension].<br><br>
    38 Ejemplos :<br>
    39 @hotmail.com -> con exclusión de direcciones *@hotmail.com<br>
    40 @hotmail -> con exclusión de todas las direcciones de *@hotmail*';
    4137$lang['UAM_infomailTitle'] = 'Información por correo electrónico para el usuario';
    4238$lang['UAM_infomailTitle_d'] = 'Esta opción permite automatizar el envío de un correo electrónico y la información a un usuario cuando se registra o cuando cambie su contraseña o dirección de correo electrónico en su perfil.<br><br>
     
    184180Atención: Esta característica no se aplica a todos los usuarios registrados. Las personas con estados &quot;admin&quot;, &quot;webmaster&quot; o &quot;generic&quot; están excluidos.';
    185181// --------- End: New or revised $lang ---- from version 2.15.6
     182
     183// --------- Starting below: New or revised $lang ---- from version 2.15.7
     184$lang['UAM_mailexcTitle_d'] = 'De forma predeterminada, Piwigo acepta todas las direcciones de correo electrónico en el  formato xxx@yyy.zz. Al habilitar esta opción le permite excluir ciertos dominios en el formato: @[nombreDeDominio].[Domain_extension].<br><br>
     185Ejemplos :<br>
     186@hotmail.com -> con exclusión de direcciones *@hotmail.com<br>
     187@hotmail -> con exclusión de todas las direcciones de *@hotmail*
     188<br><br>
     189<b style=&quot;color: red;&quot;>La convulsión sólo es posible tras el registro de la opción en la posición activada.</b>';
     190// --------- End: New or revised $lang ---- from version 2.15.7
    186191?>
  • extensions/NBC_UserAdvManager/branches/2.15/language/fr_FR/help/plugin.lang.php

    r6823 r7000  
    3434A noter : Si l\'utilisateur du compte ainsi créé désire changer de mot de passe et que le renforcement des mots de passe pour les utilisateurs est actif, il sera soumis à la règle configurée.';
    3535$lang['UAM_mailexcTitle'] = 'Exclusion des domaines de messagerie';
    36 $lang['UAM_mailexcTitle_d'] = 'Par défaut, Piwigo accepte toutes les adresses de messagerie au format xxx@yyy.zz. L\'activation de cette option permet d\'exclure certains domaines selon le format : @[nom_du_domaine].[extension_du_domaine].<br><br>
    37 Exemples :<br>
    38 @hotmail.com -> exclusion des adresses *@hotmail.com<br>
    39 @hotmail -> exclusion de toutes les adresses *@hotmail*';
    4036$lang['UAM_infomailTitle'] = 'Email d\'information';
    4137$lang['UAM_infomailTitle_d'] = 'Cette option permet d\'automatiser l\'envoi d\'un email d\'information à un utilisateur lorsqu\'il s\'inscrit ou modifie son mot de passe ou son adresse de messagerie dans son profil.<br><br>
     
    181177A savoir: Cette fonction ne s\'applique pas à tous les utilisateurs déjà inscrits. Ceux disposant du status &quot;admin&quot;, &quot;webmaster&quot; ou &quot;generique&quot; sont exclus de la règle.';
    182178// --------- End: New or revised $lang ---- from version 2.15.6
     179
     180// --------- Starting below: New or revised $lang ---- from version 2.15.7
     181$lang['UAM_mailexcTitle_d'] = 'Par défaut, Piwigo accepte toutes les adresses de messagerie au format xxx@yyy.zz. L\'activation de cette option permet d\'exclure certains domaines selon le format : @[nom_du_domaine].[extension_du_domaine].<br><br>
     182Exemples :<br>
     183@hotmail.com -> exclusion des adresses *@hotmail.com<br>
     184@hotmail -> exclusion de toutes les adresses *@hotmail*
     185<br><br>
     186<b style=&quot;color: red;&quot;>La saisie n\'est possible qu\'après enregistrement de l\'option en position activée.</b>';
     187// --------- End: New or revised $lang ---- from version 2.15.7
    183188?>
  • extensions/NBC_UserAdvManager/branches/2.15/language/it_IT/help/plugin.lang.php

    r6823 r7000  
    3535Nota: Se l\'account utente creato vuole cambiare la password e il rafforzamento password per gli utenti è attivo, sarà soggetta alla regola.';
    3636$lang['UAM_mailexcTitle'] = 'L\'esclusione Email domini';
    37 $lang['UAM_mailexcTitle_d'] = 'Per impostazione predefinita, PhpWebGallery accetta tutti gli indirizzi di posta elettronica nel xxx@yyy.zz formato. L\'attivazione di questa opzione consente di escludere determinati domini nel formato: @[nome_dominio].[Domain_extension].<br><br>
    38 Esempi :<br>
    39 @hotmail.com -> esclusi gli indirizzi *@hotmail.com<br>
    40 @hotmail -> escludendo tutti gli indirizzi *@hotmail*';
    4137$lang['UAM_infomailTitle'] = 'E-mail informazioni per l\'utente';
    4238$lang['UAM_infomailTitle_d'] = 'Questa opzione consente di automatizzare l\'invio di una e-mail le informazioni a un utente al momento della registrazione o quando cambia la sua password o indirizzo e-mail nel loro profilo.<br><br>
     
    180176Please note: This feature does not apply to all registered users. Those with &quot;admin&quot;, &quot;webmaster&quot; or &quot;generic&quot; status are excluded.';
    181177// --------- End: New or revised $lang ---- from version 2.15.6
     178
     179// --------- Starting below: New or revised $lang ---- from version 2.15.7
     180$lang['UAM_mailexcTitle_d'] = 'Per impostazione predefinita, PhpWebGallery accetta tutti gli indirizzi di posta elettronica nel xxx@yyy.zz formato. L\'attivazione di questa opzione consente di escludere determinati domini nel formato: @[nome_dominio].[Domain_extension].<br><br>
     181Esempi :<br>
     182@hotmail.com -> esclusi gli indirizzi *@hotmail.com<br>
     183@hotmail -> escludendo tutti gli indirizzi *@hotmail*
     184<br><br>
     185<b style=&quot;color: red;&quot;>Il sequestro è possibile solo dopo la registrazione della facoltà in posizione attiva.</b>';
     186// --------- End: New or revised $lang ---- from version 2.15.7
    182187?>
  • extensions/NBC_UserAdvManager/branches/2.15/main.inc.php

    r6823 r7000  
    22/*
    33Plugin Name: UserAdvManager
    4 Version: 2.15.6
     4Version: 2.15.7
    55Description: Renforcer la gestion des utilisateurs - Enforce users management
    66Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=216
     
    5656  $conf_UAM = unserialize($conf['UserAdvManager']);
    5757
    58   /* Admins and Guests are not tracked for Ghost Tracker or Users Tracker */
    59   if (!is_admin() and !is_a_guest())
     58  /* Admins, Guests and Adult_Content users are not tracked for Ghost Tracker or Users Tracker */
     59  if (!is_admin() and !is_a_guest() and $user['username'] != "16" and $user['username'] != "18")
    6060  {
    6161    if ((isset($conf_UAM[16]) and $conf_UAM[16] == 'true') or (isset($conf_UAM[19]) and $conf_UAM[19] == 'true'))
     
    106106
    107107  $conf_UAM = unserialize($conf['UserAdvManager']);
    108  
    109   if ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') and (isset($conf_UAM[1]) and $conf_UAM[1] == 'local'))
    110   {
    111     /* This is to send an information email and set user to "waiting" group or status until admin validation */
    112     $passwd = (isset($_POST['password'])) ? $_POST['password'] : '';
    113     SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], false);
    114     setgroup($register_user['id']);// Set to "waiting" group or status until admin validation
    115   }
    116   elseif ((isset($conf_UAM[0]) and $conf_UAM[0] == 'false') and (isset($conf_UAM[1]) and $conf_UAM[1] == 'local'))
    117   {
    118     /* This is to set user to "wainting" group or status until admin validation */
    119     setgroup($register_user['id']);// Set to "waiting" group or status until admin validation
    120   }
    121   elseif ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') and (isset($conf_UAM[1]) and $conf_UAM[1] == 'false'))
    122   {
    123     /* This is to send an information email without validation key */
    124     $passwd = (isset($_POST['password'])) ? $_POST['password'] : '';
    125     SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], false);
    126   }
    127   /* Sending registration confirmation by email */
    128   elseif ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') and (isset($conf_UAM[1]) and $conf_UAM[1] == 'true'))
    129   {
    130     if (is_admin() and isset($conf_UAM[20]) and $conf_UAM[20] == 'true')
    131     {
    132       $passwd = (isset($_POST['password'])) ? $_POST['password'] : '';
    133       SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], true);
    134     }
    135     elseif (is_admin() and isset($conf_UAM[20]) and $conf_UAM[20] == 'false')
    136     {
     108
     109  // Exclusion of Adult_Content users
     110  if ($register_user['username'] != "16" and $register_user['username'] != "18")
     111  {
     112    if ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') and (isset($conf_UAM[1]) and $conf_UAM[1] == 'local') and ($register_user['username'] != "16" and $register_user['username'] != "18"))
     113    {
     114      /* This is to send an information email and set user to "waiting" group or status until admin validation */
    137115      $passwd = (isset($_POST['password'])) ? $_POST['password'] : '';
    138116      SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], false);
    139     }
    140     elseif (!is_admin())
    141     {
     117      setgroup($register_user['id']);// Set to "waiting" group or status until admin validation
     118    }
     119    elseif ((isset($conf_UAM[0]) and $conf_UAM[0] == 'false') and (isset($conf_UAM[1]) and $conf_UAM[1] == 'local') and ($register_user['username'] != "16" and $register_user['username'] != "18"))
     120    {
     121      /* This is to set user to "waiting" group or status until admin validation */
     122      setgroup($register_user['id']);// Set to "waiting" group or status until admin validation
     123    }
     124    elseif ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') and (isset($conf_UAM[1]) and $conf_UAM[1] == 'false') and ($register_user['username'] != "16" and $register_user['username'] != "18"))
     125    {
     126      /* This is to send an information email without validation key */
    142127      $passwd = (isset($_POST['password'])) ? $_POST['password'] : '';
    143       SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], true);
     128      SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], false);
     129    }
     130    /* Sending registration confirmation by email */
     131    elseif ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') and (isset($conf_UAM[1]) and $conf_UAM[1] == 'true') and ($register_user['username'] != "16" and $register_user['username'] != "18"))
     132    {
     133      if (is_admin() and isset($conf_UAM[20]) and $conf_UAM[20] == 'true')
     134      {
     135        $passwd = (isset($_POST['password'])) ? $_POST['password'] : '';
     136        SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], true);
     137      }
     138      elseif (is_admin() and isset($conf_UAM[20]) and $conf_UAM[20] == 'false')
     139      {
     140        $passwd = (isset($_POST['password'])) ? $_POST['password'] : '';
     141        SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], false);
     142      }
     143      elseif (!is_admin())
     144      {
     145        $passwd = (isset($_POST['password'])) ? $_POST['password'] : '';
     146        SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], true);
     147      }
    144148    }
    145149  }
     
    161165
    162166
    163 /* Check users registration */
     167// Check users registration
    164168add_event_handler('register_user_check', 'UAM_RegistrationCheck', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
    165169
     
    168172  global $errors, $conf;
    169173
    170 /* *********************************************************** */
    171 /* We need to reset the standard Piwigo's register controls    */
    172 /* because the call of register_user_check trigger resets them */
    173 /* *********************************************************** */
    174   /* ********************************** */
    175   /* Standard Piwigo's username control */
    176   /* ********************************** */
    177   if ($_POST['login'] == '')
    178   {
    179     return l10n('reg_err_login1');
    180   }
    181   if (preg_match('/^.* $/', $_POST['login']))
    182   {
    183     return l10n('reg_err_login2');
    184   }
    185   if (preg_match('/^ .*$/', $_POST['login']))
    186   {
    187     return l10n('reg_err_login3');
    188   }
    189   if (get_userid($_POST['login']))
    190   {
    191     return l10n('reg_err_login5');
    192   }
    193  
    194   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*/
    195   {
    196   /* Email doblons check */
    197     $atom   = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]';   // before  arobase
    198     $domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; // domain name
    199     $regex = '/^' . $atom . '+' . '(\.' . $atom . '+)*' . '@' . '(' . $domain . '{1,63}\.)+' . $domain . '{2,63}$/i';
    200  
    201     if (!preg_match($regex, $_POST['email']))
    202     {
    203       return l10n('reg_err_mail_address');
    204     }
     174  // Exclusion of Adult_Content users
     175  if ($user['username'] != "16" and $user['username'] != "18")
     176  {
     177// ***********************************************************
     178// We need to reset the standard Piwigo's register controls   
     179// because the call of register_user_check trigger resets them
     180// ***********************************************************
     181  // **********************************
     182  // Standard Piwigo's username control
     183  // **********************************
     184    if ($_POST['login'] == '')
     185    {
     186      return l10n('reg_err_login1');
     187    }
     188    if (preg_match('/^.* $/', $_POST['login']))
     189    {
     190      return l10n('reg_err_login2');
     191    }
     192    if (preg_match('/^ .*$/', $_POST['login']))
     193    {
     194      return l10n('reg_err_login3');
     195    }
     196    if (get_userid($_POST['login']))
     197    {
     198      return l10n('reg_err_login5');
     199    }
     200 
     201    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
     202    {
     203    // Email doblons check
     204      $atom   = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]';   // before  arobase
     205      $domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; // domain name
     206      $regex = '/^' . $atom . '+' . '(\.' . $atom . '+)*' . '@' . '(' . $domain . '{1,63}\.)+' . $domain . '{2,63}$/i';
     207 
     208      if (!preg_match($regex, $_POST['email']))
     209      {
     210        return l10n('reg_err_mail_address');
     211      }
    205212   
    206     $query = '
     213      $query = '
    207214SELECT count(*)
    208215FROM '.USERS_TABLE.'
    209216WHERE upper('.$conf['user_fields']['email'].') = upper(\''.$_POST['email'].'\')
    210217;';
    211     list($count) = pwg_db_fetch_row(pwg_query($query));
    212     if ($count != 0)
    213     {
    214       return l10n('reg_err_mail_address_dbl');
    215     }
    216   }
    217 
    218   if (script_basename() == 'register') /* not the same email variable if we are on users registration page or on admin's user registration page*/
    219   {
    220   /* Email doblons check */
    221     $atom   = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]';   // before  arobase
    222     $domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; // domain name
    223     $regex = '/^' . $atom . '+' . '(\.' . $atom . '+)*' . '@' . '(' . $domain . '{1,63}\.)+' . $domain . '{2,63}$/i';
    224  
    225     if (!preg_match($regex, $_POST['mail_address']))
    226     {
    227       return l10n('reg_err_mail_address');
    228     }
     218      list($count) = pwg_db_fetch_row(pwg_query($query));
     219      if ($count != 0)
     220      {
     221        return l10n('reg_err_mail_address_dbl');
     222      }
     223    }
     224
     225    if (script_basename() == 'register') // not the same email variable if we are on users registration page or on admin's user registration page
     226    {
     227  // Email doblons check
     228      $atom   = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]';   // before  arobase
     229      $domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; // domain name
     230      $regex = '/^' . $atom . '+' . '(\.' . $atom . '+)*' . '@' . '(' . $domain . '{1,63}\.)+' . $domain . '{2,63}$/i';
     231 
     232      if (!preg_match($regex, $_POST['mail_address']))
     233      {
     234        return l10n('reg_err_mail_address');
     235      }
    229236   
    230     $query = '
     237      $query = '
    231238SELECT count(*)
    232239FROM '.USERS_TABLE.'
    233240WHERE upper('.$conf['user_fields']['email'].') = upper(\''.$_POST['mail_address'].'\')
    234241;';
    235     list($count) = pwg_db_fetch_row(pwg_query($query));
    236     if ($count != 0)
    237     {
    238       return l10n('reg_err_mail_address_dbl');
    239     }
    240   }
    241 /* ****************************************** */
    242 /* End of Piwigo's standard register controls */
    243 /* ****************************************** */
    244 
    245 
    246 /* ****************************************** */
    247 /* Here begins the advanced register controls */
    248 /* ****************************************** */
    249   $PasswordCheck = 0;
    250 
    251   $conf_UAM = unserialize($conf['UserAdvManager']);
    252 
    253   /* Password enforcement control */
    254   if (isset($conf_UAM[13]) and $conf_UAM[13] == 'true' and !empty($conf_UAM[14]))
    255   {
    256     if (!empty($user['password']) and !is_admin())
    257     {
    258       $PasswordCheck = testpassword($user['password']);
    259  
    260       if ($PasswordCheck < $conf_UAM[14])
    261       {
    262         $message = get_l10n_args('reg_err_login4_%s', $PasswordCheck);
    263         return($lang['reg_err_pass'] = l10n_args($message).$conf_UAM[14]);
    264       }
    265     }
    266     else if (!empty($user['password']) and is_admin() and isset($conf_UAM[15]) and $conf_UAM[15] == 'true')
    267     {
    268       $PasswordCheck = testpassword($user['password']);
    269  
    270       if ($PasswordCheck < $conf_UAM[14])
    271       {
    272         $message = get_l10n_args('reg_err_login4_%s', $PasswordCheck);
    273         return($lang['reg_err_pass'] = l10n_args($message).$conf_UAM[14]);
    274       }
    275     }
    276   }
    277 
    278   /* Username without forbidden keys */
    279   if (isset($conf_UAM[6]) and $conf_UAM[6] == 'true' and !empty($_POST['login']) and ValidateUsername($_POST['login']) and !is_admin())
    280   {
    281     $_POST['login'] = '';
    282     return($lang['reg_err_login1'] = l10n('reg_err_login6')."'".$conf_UAM[7]."'");
    283   }
    284 
    285   /* Email without forbidden domains */
    286   if (isset($conf_UAM[11]) and $conf_UAM[11] == 'true' and !empty($_POST['mail_address']) and ValidateEmailProvider($_POST['mail_address']) and !is_admin())
    287   {
    288     $_POST['mail_address'] = '';
    289     return($lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_UAM[12]."'");
     242      list($count) = pwg_db_fetch_row(pwg_query($query));
     243      if ($count != 0)
     244      {
     245        return l10n('reg_err_mail_address_dbl');
     246      }
     247    }
     248// ******************************************
     249// End of Piwigo's standard register controls
     250// ******************************************
     251
     252
     253// ******************************************
     254// Here begins the advanced register controls
     255// ******************************************
     256    $PasswordCheck = 0;
     257
     258    $conf_UAM = unserialize($conf['UserAdvManager']);
     259
     260    // Password enforcement control
     261    if (isset($conf_UAM[13]) and $conf_UAM[13] == 'true' and !empty($conf_UAM[14]))
     262    {
     263      if (!empty($user['password']) and !is_admin())
     264      {
     265        $PasswordCheck = testpassword($user['password']);
     266 
     267        if ($PasswordCheck < $conf_UAM[14])
     268        {
     269          $message = get_l10n_args('reg_err_login4_%s', $PasswordCheck);
     270          return($lang['reg_err_pass'] = l10n_args($message).$conf_UAM[14]);
     271        }
     272      }
     273      else if (!empty($user['password']) and is_admin() and isset($conf_UAM[15]) and $conf_UAM[15] == 'true')
     274      {
     275        $PasswordCheck = testpassword($user['password']);
     276 
     277        if ($PasswordCheck < $conf_UAM[14])
     278        {
     279          $message = get_l10n_args('reg_err_login4_%s', $PasswordCheck);
     280          return($lang['reg_err_pass'] = l10n_args($message).$conf_UAM[14]);
     281        }
     282      }
     283    }
     284
     285    // Username without forbidden keys
     286    if (isset($conf_UAM[6]) and $conf_UAM[6] == 'true' and !empty($_POST['login']) and ValidateUsername($_POST['login']) and !is_admin())
     287    {
     288      $_POST['login'] = '';
     289      return($lang['reg_err_login1'] = l10n('reg_err_login6')."'".$conf_UAM[7]."'");
     290    }
     291
     292    // Email without forbidden domains
     293    if (isset($conf_UAM[11]) and $conf_UAM[11] == 'true' and !empty($_POST['mail_address']) and ValidateEmailProvider($_POST['mail_address']) and !is_admin())
     294    {
     295      $_POST['mail_address'] = '';
     296      return($lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_UAM[12]."'");
     297    }
    290298  }
    291299}
     
    301309
    302310    $conf_UAM = unserialize($conf['UserAdvManager']);
    303 
     311   
    304312    if ((isset($conf_UAM[21]) and $conf_UAM[21] == 'true'))
    305313    {
Note: See TracChangeset for help on using the changeset viewer.