524 - password policy

"change pwd" page: add feedback during the password typing
This commit is contained in:
bruno DA SILVA
2020-01-06 09:31:28 +01:00
parent 97ebffd5fb
commit 7a85201a07
4 changed files with 151 additions and 1 deletions

View File

@@ -1062,6 +1062,21 @@ class LoginWebPage extends NiceWebPage
exit;
}
}
else if ($operation == 'check_pwd_policy')
{
$aPwdMap = array();
foreach (array('new_pwd', 'retype_new_pwd') as $postedPwd)
{
$oUser = new UserLocal();
$oUser->ValidatePassword($_POST[$postedPwd]);
$aPwdMap[$postedPwd]['isValid'] = $oUser->IsPasswordValid();
$aPwdMap[$postedPwd]['message'] = $oUser->getPasswordValidityMessage();
}
echo json_encode($aPwdMap);
die();
}
if ($operation == 'do_change_pwd')
{
if (isset($_SESSION['auth_user']))