From 5d51114b8d6b63ee7dbcab25acc78f274c7a1ead Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Thu, 16 Dec 2021 19:14:20 +0100 Subject: [PATCH] Revert zxcvbn usage in LSexample to keep PHP5 support Also add note about LSformRule_zxcvbn requirement of PHP >= 7. --- doc/conf/LSattribute/check_data/zxcvbn.docbook | 3 +++ src/conf/LSobjects/config.LSobjects.LSpeople.php | 14 +++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/doc/conf/LSattribute/check_data/zxcvbn.docbook b/doc/conf/LSattribute/check_data/zxcvbn.docbook index 42778f08..da5d891b 100644 --- a/doc/conf/LSattribute/check_data/zxcvbn.docbook +++ b/doc/conf/LSattribute/check_data/zxcvbn.docbook @@ -8,6 +8,9 @@ la base de l'analyse du mot de passe saisi, des conseils seront donnés à l'utilisateur pour le guider dans le choix d'un mot de passe sûre. + La librairie ZxcvbnPhp n'est compatible qu'avec + PHP 7 et supérieur. + Paramètres de configuration diff --git a/src/conf/LSobjects/config.LSobjects.LSpeople.php b/src/conf/LSobjects/config.LSobjects.LSpeople.php index c4bf4c68..f2244681 100644 --- a/src/conf/LSobjects/config.LSobjects.LSpeople.php +++ b/src/conf/LSobjects/config.LSobjects.LSpeople.php @@ -553,10 +553,18 @@ $GLOBALS['LSobjects']['LSpeople'] = array ( 'confirmChangeQuestion' => "Do you confirm change of this user's password?", ), 'check_data' => array( - 'zxcvbn' => array( + 'password' => array( + 'msg' => 'Your password must contain from 8 to 10 characters and contains at least one caracter that match with 3 of this types :', 'params' => array( - 'minScore' => 4, - 'userDataAttrs' => array('sn', 'givenName', 'mail'), + 'minLength' => 8, + 'maxLength' => 10, + 'regex' => array ( + '/[A-Z]/', + '/[a-z]/', + '/[0-9]/', + '/[^A-Za-z0-9]/', + ), + 'minValidRegex' => 3, ), ), ),