Skip to content
Snippets Groups Projects
Commit 7d12d99a authored by Florian Azizian's avatar Florian Azizian
Browse files

FIX #14788 TIME 0:05 fix bypass password modification rule

parent 6648e578
No related branches found
No related tags found
No related merge requests found
......@@ -203,6 +203,21 @@ if (!empty($_REQUEST['page']) && empty($_REQUEST['triggerAngular'])) {
} else {
header('location: index.php?display=true&page=logout&logout=true');
}
$user = \User\models\UserModel::getByLogin(['login' => $cookie['userId'], 'select' => ['password_modification_date']]);
$loggingMethod = \SrcCore\models\CoreConfigModel::getLoggingMethod();
if (!in_array($loggingMethod['id'], ['sso', 'cas', 'ldap', 'keycloak', 'shibboleth'])) {
$passwordRules = \SrcCore\models\PasswordModel::getEnabledRules();
if (!empty($passwordRules['renewal'])) {
$currentDate = new \DateTime();
$lastModificationDate = new \DateTime($user['password_modification_date']);
$lastModificationDate->add(new DateInterval("P{$passwordRules['renewal']}D"));
if ($currentDate > $lastModificationDate) {
header('location: index.php?display=true&page=logout&logout=true');
}
}
}
}
//INSERT PART OF PAGE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment