Changeset 4061


Ignore:
Timestamp:
Oct 19, 2009, 6:22:25 PM (15 years ago)
Author:
Eric
Message:

[NBC_UserAdvManager]

  • Bug 1195 fixed : Registration page displays now the good title
  • Some code cleaning
Location:
extensions/NBC_UserAdvManager/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • extensions/NBC_UserAdvManager/trunk/admin/UserAdvManager_admin.php

    r3920 r4061  
    4141$page['global'] = array();
    4242$error = array();
     43$UserAdvManager_Password_Test_Score = 0;
    4344
    4445// +-----------------------------------------------------------------------+
     
    5556  case 'global':
    5657       
    57         if ( isset($_POST['submit']) and !is_adviser() and isset($_POST['UserAdvManager_Mail_Info']) and isset($_POST['UserAdvManager_No_Casse']) and isset($_POST['UserAdvManager_Username_Char']) and isset($_POST['UserAdvManager_Confirm_Mail']) and isset($_POST['UserAdvManager_No_Comment_Anonymous']) )
     58        if (isset($_POST['submit']) and !is_adviser() and isset($_POST['UserAdvManager_Mail_Info']) and isset($_POST['UserAdvManager_No_Casse']) and isset($_POST['UserAdvManager_Username_Char']) and isset($_POST['UserAdvManager_Confirm_Mail']) and isset($_POST['UserAdvManager_No_Comment_Anonymous']) and isset($_POST['UserAdvManager_Password_Enforced']))
    5859  {
    5960                $_POST['UserAdvManager_MailInfo_Text'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_MailInfo_Text']));
    6061                $_POST['UserAdvManager_ConfirmMail_Text'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_ConfirmMail_Text']));
    6162               
    62                 $newconf_nbc_UserAdvManager = $_POST['UserAdvManager_Mail_Info'].';'.$_POST['UserAdvManager_No_Casse'].';'.$_POST['UserAdvManager_Confirm_Mail'].';'.(isset($_POST['UserAdvManager_No_Confirm_Group'])?$_POST['UserAdvManager_No_Confirm_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Group'])?$_POST['UserAdvManager_Validated_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Status'])?$_POST['UserAdvManager_Validated_Status']:'').';'.$_POST['UserAdvManager_No_Comment_Anonymous'].';'.$_POST['UserAdvManager_Username_Char'].';'.$_POST['UserAdvManager_Username_List'].';'.(isset($_POST['UserAdvManager_No_Confirm_Status'])?$_POST['UserAdvManager_No_Confirm_Status']:'').';'.$_POST['UserAdvManager_MailInfo_Text'].';'.$_POST['UserAdvManager_ConfirmMail_Text'].';'.$_POST['UserAdvManager_MailExclusion'].';'.$_POST['UserAdvManager_MailExclusion_List'];
     63                $newconf_nbc_UserAdvManager = $_POST['UserAdvManager_Mail_Info'].';'.$_POST['UserAdvManager_No_Casse'].';'.$_POST['UserAdvManager_Confirm_Mail'].';'.(isset($_POST['UserAdvManager_No_Confirm_Group'])?$_POST['UserAdvManager_No_Confirm_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Group'])?$_POST['UserAdvManager_Validated_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Status'])?$_POST['UserAdvManager_Validated_Status']:'').';'.$_POST['UserAdvManager_No_Comment_Anonymous'].';'.$_POST['UserAdvManager_Username_Char'].';'.$_POST['UserAdvManager_Username_List'].';'.(isset($_POST['UserAdvManager_No_Confirm_Status'])?$_POST['UserAdvManager_No_Confirm_Status']:'').';'.$_POST['UserAdvManager_MailInfo_Text'].';'.$_POST['UserAdvManager_ConfirmMail_Text'].';'.$_POST['UserAdvManager_MailExclusion'].';'.$_POST['UserAdvManager_MailExclusion_List'].';'.$_POST['UserAdvManager_Password_Enforced'].';'.$_POST['UserAdvManager_Password_Score'];
    6364               
    6465                $conf['nbc_UserAdvManager'] = $newconf_nbc_UserAdvManager;
     
    7475               
    7576                array_push($page['infos'], l10n('UserAdvManager_save_config'));
     77  }
     78
     79  if (isset($_POST['PasswordTest']) and !is_adviser() and isset($_POST['UserAdvManager_Password_Test']) and !empty($_POST['UserAdvManager_Password_Test']))
     80  {
     81    $UserAdvManager_Password_Test_Score = testpassword($_POST['UserAdvManager_Password_Test']);
     82  }
     83  else if (isset($_POST['PasswordTest']) and !is_adviser() and empty($_POST['UserAdvManager_Password_Test']))
     84  {
     85    array_push($page['errors'], l10n('reg_err_login3'));
    7686  }
    7787       
     
    189199                'UserAdvManager_MAILEXCLUSION_FALSE'  => $conf_nbc_UserAdvManager[12]=='false' ?  'checked="checked"' : '' ,
    190200                'UserAdvManager_MAILEXCLUSION_LIST'   => $conf_nbc_UserAdvManager[13],
     201                'UserAdvManager_PASSWORDENF_TRUE'     => $conf_nbc_UserAdvManager[14]=='true' ?  'checked="checked"' : '' ,
     202                'UserAdvManager_PASSWORDENF_FALSE'    => $conf_nbc_UserAdvManager[14]=='false' ?  'checked="checked"' : '' ,
     203                'UserAdvManager_PASSWORD_SCORE'       => $conf_nbc_UserAdvManager[15],
     204                'UserAdvManager_PASSWORD_TEST_SCORE'  => $UserAdvManager_Password_Test_Score,
    191205    )
    192206  );
  • extensions/NBC_UserAdvManager/trunk/admin/global.tpl

    r3982 r4061  
    77        <legend>{'UserAdvManager_Title'|@translate}</legend>
    88    <ul>
    9         <li><label>{'UserAdvManager_Mail_Info'|@translate}</label><br/>
    10         <input type="radio" value="true" {$UserAdvManager_MAIL_INFO_TRUE} name="UserAdvManager_Mail_Info"/>{'UserAdvManager_Mail_Info_true'|@translate}<br>
    11         <input type="radio" value="false" {$UserAdvManager_MAIL_INFO_FALSE} name="UserAdvManager_Mail_Info"/>{'UserAdvManager_Mail_Info_false'|@translate}<br>
    12         <br>
    13         </li>
    14         <li><label>{'UserAdvManager_MailInfo_Text'|@translate}</label><br><br>
    15         <textarea name="UserAdvManager_MailInfo_Text" id="UserAdvManager_MailInfo_Text" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_MAILINFO_TEXT}</textarea>
    16         <br><br>
    17         </li>
    189        <li><label>{'UserAdvManager_No_Casse'|@translate}</label><br>
    1910        <input type="radio" value="true" {$UserAdvManager_NO_CASSE_TRUE} name="UserAdvManager_No_Casse"/>{'UserAdvManager_No_Casse_true'|@translate}<br>
     
    2617        <input type="radio" value="false" {$UserAdvManager_USERNAME_CHAR_FALSE} name="UserAdvManager_Username_Char"/>{'UserAdvManager_Username_Char_false'|@translate}<br>
    2718        <br>
     19        </li>
     20        <li><label>{'UserAdvManager_Password_Enforced'|@translate}</label><br/>
     21        <input type="radio" value="true" {$UserAdvManager_PASSWORDENF_TRUE} name="UserAdvManager_Password_Enforced"/>{'UserAdvManager_Password_Enforced_true'|@translate}
     22        <input type="text" name="UserAdvManager_Password_Score" value="{$UserAdvManager_PASSWORD_SCORE}" size="5" style="text-align: center;"/><br><br>
     23       
     24        <label>{'UserAdvManager_Password_Enforced_Info'|@translate}</label><br><br>
     25        {'UserAdvManager_PasswordTest'|@translate}<input type="text" name="UserAdvManager_Password_Test" value="{$UserAdvManager_PASSWORD_TEST}" size="50" style="text-align: left;"/>&nbsp;&nbsp;&nbsp;
     26        <input class="submit" type="submit" value="{'PasswordTest'|@translate}" name="PasswordTest" >&nbsp;&nbsp;&nbsp;
     27        {'UserAdvManager_ScoreTest'|@translate}{$UserAdvManager_PASSWORD_TEST_SCORE}<br><br>
     28        {if isset($PasswordTest) && empty($UserAdvManager_PASSWORD_TEST)}
     29          <label>{'reg_err_login3'|@translate}</label>
     30        {/if}
     31       
     32        <input type="radio" value="false" {$UserAdvManager_PASSWORDENF_FALSE} name="UserAdvManager_Password_Enforced"/>{'UserAdvManager_Password_Enforced_false'|@translate}<br>
     33        <br>
     34        </li>
     35        <li><label>{'UserAdvManager_Mail_Info'|@translate}</label><br/>
     36        <input type="radio" value="true" {$UserAdvManager_MAIL_INFO_TRUE} name="UserAdvManager_Mail_Info"/>{'UserAdvManager_Mail_Info_true'|@translate}<br>
     37        <input type="radio" value="false" {$UserAdvManager_MAIL_INFO_FALSE} name="UserAdvManager_Mail_Info"/>{'UserAdvManager_Mail_Info_false'|@translate}<br>
     38        <br>
     39        </li>
     40        <li><label>{'UserAdvManager_MailInfo_Text'|@translate}</label><br><br>
     41        <textarea name="UserAdvManager_MailInfo_Text" id="UserAdvManager_MailInfo_Text" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_MAILINFO_TEXT}</textarea>
     42        <br><br>
    2843        </li>
    2944        <li><label>{'UserAdvManager_Confirm_Mail'|@translate}</label><br>
  • extensions/NBC_UserAdvManager/trunk/admin/usermanager.tpl

    r3920 r4061  
    1818                        <td>{'Email address'|@translate}</td>
    1919                        <td>{'Groups'|@translate}</td>
    20                         <td>{'Registration'|@translate}</td>
     20                        <td>{'Registration_Date'|@translate}</td>
    2121                        </tr>
    2222                        </thead>
  • extensions/NBC_UserAdvManager/trunk/include/functions_UserAdvManager.inc.php

    r3982 r4061  
    535535
    536536/* Obsolete function - Check for single email in database */
    537 function SearchMail($email)
    538 {
    539   global $conf, $lang;
    540  
    541   if (isset($email))
    542   {
    543     $query = "
    544       SELECT COUNT(*)
    545       FROM ".USERS_TABLE."
    546       WHERE ".$conf['user_fields']['email']." = '".$email."'
    547     ;";
    548     list($nbr_mail) = mysql_fetch_row(pwg_query($query));
    549  
    550     return isset($nbr_mail) ? $nbr_mail : 0;
    551   }
    552 }
     537//function SearchMail($email)
     538//{
     539//  global $conf, $lang;
     540// 
     541//  if (isset($email))
     542//  {
     543//    $query = "
     544//      SELECT COUNT(*)
     545//      FROM ".USERS_TABLE."
     546//      WHERE ".$conf['user_fields']['email']." = '".$email."'
     547//    ;";
     548//    list($nbr_mail) = mysql_fetch_row(pwg_query($query));
     549// 
     550//    return isset($nbr_mail) ? $nbr_mail : 0;
     551//  }
     552//}
    553553
    554554
     
    577577/* Obsolete function - Check for no forbidden email provider */
    578578/* This don't work on function call */
    579 function ValidateEmailProvider($email)
    580 {
    581   global $conf;
    582 
    583         $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
    584         if (isset($conf_nbc_UserAdvManager[12]))
    585         {
    586                 $ncsemail = strtolower($email);
    587                 $conf_nbc_MailExclusion = preg_split('/,/',$conf_nbc_UserAdvManager[13]);
    588                 for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
    589                 {
    590                         $pattern = '/'.$conf_nbc_MailExclusion[$i].'/';
    591                         if (preg_match($pattern, $ncsemail))
    592                         return false;
    593                 else
    594                         return true;
    595                 }
    596         }
    597 }
     579//function ValidateEmailProvider($email)
     580//{
     581//  global $conf;
     582//
     583//      $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
     584//      if (isset($conf_nbc_UserAdvManager[12]))
     585//      {
     586//              $ncsemail = strtolower($email);
     587//              $conf_nbc_MailExclusion = preg_split('/,/',$conf_nbc_UserAdvManager[13]);
     588//              for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
     589//              {
     590//                      $pattern = '/'.$conf_nbc_MailExclusion[$i].'/';
     591//                      if (preg_match($pattern, $ncsemail))
     592//                      return false;
     593//              else
     594//                              return true;
     595//              }
     596//      }
     597//}
    598598
    599599
     
    735735        }
    736736}
     737
     738/**
     739 * Returns a password's score for password complexity check
     740 *
     741 * @param password entered
     742 *
     743 * Thanx to MathieuGut from http://m-gut.developpez.com
     744 */
     745function testpassword($password)        { // Le mot de passe passé en paramètre - $password given by user
     746
     747// Initialisation des variables - Variables initiation
     748$points = 0;
     749$point_lowercase = 0;
     750$point_uppercase = 0;
     751$point_numbers = 0;
     752$point_characters = 0;
     753
     754// On récupère la longueur du mot de passe - Getting password lengh     
     755$length = strlen($password);
     756
     757// On fait une boucle pour lire chaque lettre - Loop to read password characters
     758for($i = 0; $i < $length; $i++)         {
     759       
     760        // On sélectionne une à une chaque lettre - Select each letters
     761        // $i étant à 0 lors du premier passage de la boucle - $i is 0 at first turn
     762        $letters = $password[$i];
     763
     764        if ($letters>='a' && $letters<='z'){
     765                // On ajoute 1 point pour une minuscule - Adding 1 point to score for a lowercase
     766                $points = $points + 1;
     767
     768                // On rajoute le bonus pour une minuscule - Adding bonus points for lowercase
     769                $point_lowercase = 1;
     770        }
     771        else if ($letters>='A' && $letters <='Z'){
     772                // On ajoute 2 points pour une majuscule - Adding 2 points to score for uppercase
     773                $points = $points + 2;
     774               
     775                // On rajoute le bonus pour une majuscule - Adding bonus points for uppercase
     776                $point_uppercase = 2;
     777        }
     778        else if ($letters>='0' && $letters<='9'){
     779                // On ajoute 3 points pour un chiffre - Adding 3 points to score for numbers
     780                $points = $points + 3;
     781               
     782                // On rajoute le bonus pour un chiffre - Adding bonus points for numbers
     783                $point_numbers = 3;
     784        }
     785        else {
     786                // On ajoute 5 points pour un caractère autre - Adding 5 points to score for special characters
     787                $points = $points + 5;
     788               
     789                // On rajoute le bonus pour un caractère autre - Adding bonus points for special characters
     790                $point_characters = 5;
     791        }
     792}
     793
     794// Calcul du coefficient points/longueur - calculating the coefficient points / length
     795$step1 = $points / $length;
     796
     797// Calcul du coefficient de la diversité des types de caractères... - Calculation of the diversity of character types...
     798$step2 = $point_lowercase + $point_uppercase + $point_numbers + $point_characters;
     799
     800// Multiplication du coefficient de diversité avec celui de la longueur - Multiplying the coefficient of diversity with that of the length
     801$score = $step1 * $step2;
     802
     803// Multiplication du résultat par la longueur de la chaîne - Multiplying the result by the length of the chain
     804$finalscore = $score * $length;
     805
     806return $finalscore;
     807}
    737808?>
  • extensions/NBC_UserAdvManager/trunk/language/en_UK/plugin.lang.php

    r3982 r4061  
    5757$lang['UserAdvManager_ConfirmMail_Remail_true'] = 'Enable email reminder';
    5858$lang['UserAdvManager_ConfirmMail_Remail_false'] = 'Disable email reminder';
    59 $lang['UserAdvManager_ConfirmMail_ReMail_Txt1'] = 'Custom content of the recall message with regeneration of validation key.<br>If left blank, the recall mail will include only the validation link. It is therefore strongly advised to take a little explanatory text. (NB: The text pre-filled with the installation of the plugin is given as an example)<br><br><b style="color: red;">(!!! </b><b style="text-decoration: underline; color: red;">WARNING !</b> <b style="color: red;">Text modification is available ONLY if email reminder is enabled. Use the multi language tags from Extended Description plugin if this plugin is activated !!!)</b>';
    60 $lang['UserAdvManager_ConfirmMail_ReMail_Txt2'] = 'Custom content of the recall message without regeneration of validation key.<br>If left blank, the recall mail will include only the validation link. It is therefore strongly advised to take a little explanatory text. (NB: The text pre-filled with the installation of the plugin is given as an example)<br><br><b style="color: red;">(!!! </b><b style="text-decoration: underline; color: red;">WARNING !</b> <b style="color: red;">Text modification is available ONLY if email reminder is enabled. Use the multi language tags from Extended Description plugin if this plugin is activated !!!)</b>';
     59$lang['UserAdvManager_ConfirmMail_ReMail_Txt1'] = 'Custom content of the recall message with regeneration of validation key.<br>If left blank, the recall mail will include only the validation link. It is therefore strongly advised to take a little explanatory text. (NB: The text pre-filled with the installation of the plugin is given as an example)<br><br>(!!! <b style="text-decoration: blink underline;">WARNING !</b> Text modification is available <b>ONLY</b> if email reminder is enabled. Use the multi language tags from Extended Description plugin if this plugin is activated !!!)';
     60$lang['UserAdvManager_ConfirmMail_ReMail_Txt2'] = 'Custom content of the recall message without regeneration of validation key.<br>If left blank, the recall mail will include only the validation link. It is therefore strongly advised to take a little explanatory text. (NB: The text pre-filled with the installation of the plugin is given as an example)<br><br>(!!! <b style="text-decoration: blink underline;">WARNING !</b> Text modification is available <b>ONLY</b> if email reminder is enabled. Use the multi language tags from Extended Description plugin if this plugin is activated !!!)';
    6161
    6262
     
    7474- Submit a registration awaiting validation manually even if the expiry date has passed <b>(forcing validation)</b>.
    7575<br>';
    76 $lang['Registration'] = 'Registration date';
     76$lang['Registration_Date'] = 'Registration date';
    7777
    7878
  • extensions/NBC_UserAdvManager/trunk/language/fr_FR/plugin.lang.php

    r3982 r4061  
    2020$lang['UserAdvManager_Username_Char_true'] = ' Interdire les caractères saisis dans le champs ci-après pour le nom d\'utilisateur lors de l\'inscription == ';
    2121$lang['UserAdvManager_Username_Char_false'] = ' Laisser le contrôle par défaut du nom d\'utilisateur.';
     22$lang['UserAdvManager_Password_Enforced'] = 'Renforcement des mots de passe - Activer cette option rend la saisie du mot de passe obligatoire à l\'inscription des visiteurs. De plus, le mot de passe saisi par le visiteur devra répondre à un score de fiabilité.';
     23$lang['UserAdvManager_Password_Enforced_Info'] = '<b style="text-decoration: underline; color: green;">Explications :</b> <b style="color: green;">Le score d\'un mot de passe est calculé en fonction des paramètres de base : longueur, types de caractères utilisés(lettres, chiffres, majuscules, minuscules, caractères spéciaux). Si le mot de passe de l\'utilisateur ne répond pas au score, le score réalisé est affiché ainsi que le score planchet et une indication pour augmenter la valeur de ce score. Pour donner un ordre d\'idée, un score inférieur à 100 est considéré comme faible. Entre 100 et 500, la fiabilité est renforcée. Au dela de 500, c\'est Fort Knox !! ;-)<br>Vous pouvez tester la fiabilité d\'un mot de passe en utilisant les champs ci-dessous (pour test uniquement !) ;-)</b>';
     24$lang['UserAdvManager_PasswordTest'] = 'Mot de passe à tester : ';
     25$lang['UserAdvManager_ScoreTest'] = 'Score obtenu : ';
     26$lang['PasswordTest'] = 'Calcul du score';
     27$lang['UserAdvManager_Password_Enforced_true'] = ' Mot de passe renforcé obligatoire - Saisir le score minimum (planchet)de fiabilité du mots de passe == ';
     28$lang['UserAdvManager_Password_Enforced_false'] = ' Ne pas renforcer les mots de passe (fonctionnement normal)';
    2229$lang['UserAdvManager_Confirm_Mail'] = 'Confirmation de l\'adresse email';
    2330$lang['UserAdvManager_Confirm_Mail_true'] = ' Envoyer un mail permettant a l\'utilisateur de confirmer son adresse email et donc son compte utilisateur.';
     
    5764$lang['UserAdvManager_ConfirmMail_Remail_true'] = 'Activer le rappel par mail';
    5865$lang['UserAdvManager_ConfirmMail_Remail_false'] = 'Désactiver le rappel par mail';
    59 $lang['UserAdvManager_ConfirmMail_ReMail_Txt1'] = 'Contenu personnalisé du message de rappel avec regénération de clé de validation.<br>Si laissé vide, le mail de rappel ne comportera que le lien de validation. Il est donc vivement conseillé de saisir un petit texte explicatif. (NB : Le texte pré renseigné à l\'installation du plugin est donné en exemple)<br><br><b style="color: red;">(!!! </b><b style="text-decoration: underline; color: red;">ATTENTION !</b> <b style="color: red;">La modification du texte n\'est possible QUE si le rappel par email est activé. Utilisez la méthode multi language du plugin Extended Description si celui-ci est activé !!!)</b>';
    60 $lang['UserAdvManager_ConfirmMail_ReMail_Txt2'] = 'Contenu personnalisé du message de rappel sans regénération de clé de validation.<br>Si laissé vide, le mail de rappel sera vide. Il est donc vivement conseillé de saisir un petit texte explicatif. (NB : Le texte pré renseigné à l\'installation du plugin est donné en exemple)<br><br><b style="color: red;">(!!! </b><b style="text-decoration: underline; color: red;">ATTENTION !</b> <b style="color: red;">La modification du texte n\'est possible QUE si le rappel par email est activé. Utilisez la méthode multi language du plugin Extended Description si celui-ci est activé !!!)</b>';
     66$lang['UserAdvManager_ConfirmMail_ReMail_Txt1'] = 'Contenu personnalisé du message de rappel avec regénération de clé de validation.<br>Si laissé vide, le mail de rappel ne comportera que le lien de validation. Il est donc vivement conseillé de saisir un petit texte explicatif. (NB : Le texte pré renseigné à l\'installation du plugin est donné en exemple)<br><br><b style="color: red;">(!!! </b><b style="text-decoration: underline; color: red;">ATTENTION !</b> <b style="color: red;">La modification du texte n\'est possible <b>QUE</b> si le rappel par email est activé. Utilisez la méthode multi language du plugin Extended Description si celui-ci est activé !!!)</b>';
     67$lang['UserAdvManager_ConfirmMail_ReMail_Txt2'] = 'Contenu personnalisé du message de rappel sans regénération de clé de validation.<br>Si laissé vide, le mail de rappel sera vide. Il est donc vivement conseillé de saisir un petit texte explicatif. (NB : Le texte pré renseigné à l\'installation du plugin est donné en exemple)<br><br><b style="color: red;">(!!! </b><b style="text-decoration: underline; color: red;">ATTENTION !</b> <b style="color: red;">La modification du texte n\'est possible <b>QUE</b> si le rappel par email est activé. Utilisez la méthode multi language du plugin Extended Description si celui-ci est activé !!!)</b>';
    6168
    6269
     
    7481- Valider manuellement une inscription en attente de validation même si la date d\'expiration est révolue <b>(forçage de la validation)</b>.
    7582<br>';
    76 $lang['Registration'] = 'Date d\'enregistrement';
     83$lang['Registration_Date'] = 'Date d\'enregistrement';
    7784
    7885
     
    103110$lang['Err_audit_advise'] = '<b>Vous avez des corrections a faire pour respecter les nouvelles règles que vous avez activé<br>utilisez un utilitaire de gestion de base de données pour corriger les comptes utilisateurs directement dans la table ###_USERS si nécessaire.</b>';
    104111$lang['UserAdvManager_Empty Author'] = 'Le champs auteur doit être rempli pour enregistrer un commentaire.';
     112$lang['reg_err_login3'] = 'Mot de passe obligatoire !';
     113$lang['reg_err_login4'] = 'Le mot de passe choisi est trop faible.';
    105114if ( isset($conf_UserAdvManager[1]) and $conf_UserAdvManager[1] == 'true' )
    106115        $lang['reg_err_login5'] = 'ce nom utilisateur est déjà pris, ATTENTION le nom est insensible à la casse (Majuscule = Minuscule).';
  • extensions/NBC_UserAdvManager/trunk/main.inc.php

    r3982 r4061  
    22/*
    33Plugin Name: NBC UserAdvManager
    4 Version: 2.11.4
     4Version: 2.11.5
    55Description: Permet de renforcer les possibilités de gestion des utilisateurs - Enforce users management
    66Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=216
     
    6767                                                Bug 1179 fixed : Adding a notice in plugin inline documentation for use of validation groups and status. A default group must be set in Piwigo's groups settings and the "Guest" (or another user) must be set as default for status values.
    6868                                                Bug 1182 fixed : Language tag missing in confirmation email generation
     69
     70-- 2.11.5 : Bug 1195 fixed : Registration displays the good title
     71
     72-- pre 2.12.0 : Password control and enforcement (step 1)
    6973
    7074*/
     
    157161  load_language('plugin.lang', NBC_UserAdvManager_PATH);
    158162  global $conf, $template, $page, $lang;
     163 
     164  $PasswordCheck = 0;
    159165
    160166  $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
     
    163169  if ( isset($conf_nbc_UserAdvManager[1]) and $conf_nbc_UserAdvManager[1] == 'true' )
    164170    $lang['reg_err_login5'] = l10n('reg_err_login5');
    165  
    166 
     171   
    167172 
    168 /* User identification */
     173/* User identication */
    169174  if (script_basename() == 'identification')
    170175  {
     
    248253
    249254
     255  if (isset($conf_nbc_UserAdvManager[14]) and $conf_nbc_UserAdvManager[14] == 'true' and !empty($conf_nbc_UserAdvManager[15]))
     256  {
     257    //$PasswordCheck = testpassword($_POST['password']);
     258    $PasswordCheck = 10;
     259    if ($PasswordCheck < $conf_nbc_UserAdvManager[15])
     260    {
     261      array_push($errors, l10n('reg_err_login4')."'".$conf_nbc_UserAdvManager[15]."'");
     262      //$lang['reg_err_login1'] = l10n('reg_err_login4')."'".$conf_nbc_UserAdvManager[15]."'";
     263      $_POST['password'] = "";
     264      $_POST['password_conf'] = "";
     265      $PasswordCheck = 0;
     266    }
     267  }
     268
    250269      /* Email without forbidden domains */
    251270      /* This don't work on call of ValidateEmailProvider() function - Why ?? -> Due to the "return = false|true" in function ?*/
     
    348367            $errors[] = l10n('New password confirmation does not correspond');
    349368          }
    350      
     369
     370          if (isset($conf_nbc_UserAdvManager[14]) and $conf_nbc_UserAdvManager[14] == 'true' and !empty($conf_nbc_UserAdvManager[15]))
     371          {
     372            //$PasswordCheck = testpassword($_POST['password']);
     373            $PasswordCheck = 10;
     374            if ($PasswordCheck < $conf_nbc_UserAdvManager[15])
     375            {
     376              $lang['reg_err_login1'] = l10n('reg_err_login4')."'".$conf_nbc_UserAdvManager[15]."'";
     377            }
     378          }
     379          else if (isset($conf_nbc_UserAdvManager[14]) and $conf_nbc_UserAdvManager[14] == 'true')
     380          {
     381            $lang['reg_err_login1'] = l10n('reg_err_login3');
     382          }
     383
    351384          if ( !defined('IN_ADMIN') )
    352385          {// changing password requires old password
  • extensions/NBC_UserAdvManager/trunk/maintain.inc.php

    r3881 r4061  
    1212  $q = '
    1313    INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
    14     VALUES ("nbc_UserAdvManager","true;false;false;-1;-1;-1;false;false;;-1;;;false;;","Parametres du plugin nbc UserAdvManager")
     14    VALUES ("nbc_UserAdvManager","true;false;false;-1;-1;-1;false;false;;-1;;;false;;false;100;","Parametres du plugin nbc UserAdvManager")
    1515  ;';
    1616  pwg_query($q);
     
    5858        if ($count == 0)
    5959        {
    60                 upgrade_UserAdvManager();
     60                upgrade_210();
    6161        }
    6262}
     
    9090}
    9191
    92 function upgrade_UserAdvManager()
     92function upgrade_210()
    9393{
    9494        global $conf;
Note: See TracChangeset for help on using the changeset viewer.