PMCORE-1451 La validación de contraseñas también comprueba las políticas de las contraseñas de Active Directory.

This commit is contained in:
Roly Rudy Gutierrez Pinto
2020-10-01 20:13:13 -04:00
parent 20dfd32e6b
commit 40855f1bda

View File

@@ -350,6 +350,21 @@ try {
$userPropertyInfo['USR_LAST_UPDATE_DATE'],
$userPropertyInfo['USR_LOGGED_NEXT_TIME']
);
//The other authentication methods should not be validated by password security policies.
if (!empty($aUser['USR_AUTH_TYPE'])) {
$authType = $aUser['USR_AUTH_TYPE'];
if ($authType != "mysql" && $authType != "") {
$policiesToExclude = [
'ID_PPP_MINIMUM_LENGTH',
'ID_PPP_MAXIMUM_LENGTH',
'ID_PPP_NUMERICAL_CHARACTER_REQUIRED',
'ID_PPP_UPPERCASE_CHARACTER_REQUIRED',
'ID_PPP_SPECIAL_CHARACTER_REQUIRED'
];
$errorInPassword = array_diff($errorInPassword, $policiesToExclude);
$errorInPassword = array_values($errorInPassword);
}
}
//Get the policies enabled
$policiesInPassword = $userProperty->validatePassword('', date('Y-m-d'), $userPropertyInfo['USR_LOGGED_NEXT_TIME'], true);
//Enable change password from GAP