Skip to content
Snippets Groups Projects
Verified Commit d66705d5 authored by Jerome Boucher's avatar Jerome Boucher
Browse files

FIX #26991 TIME 00:30 fix passwordValidity when no PasswordLastChange

parent d9f84dbb
No related branches found
No related tags found
2 merge requests!838Rebase develop,!837V3.0
......@@ -236,7 +236,8 @@ class userAuthentication
private function verifyValidity($userAccount, $userLogin)
{
if ($this->securityPolicy['passwordValidity'] && $this->securityPolicy["passwordValidity"] != 0) {
$diff = ($userLogin->lastLogin->getTimestamp() - $userAccount->passwordLastChange->getTimestamp());
$userPasswordLastChange = $userAccount->passwordLastChange->getTimestamp() ?? 0;
$diff = ($userLogin->lastLogin->getTimestamp() - $userPasswordLastChange);
// (timestamp de dernier login - timestamp de dernier chgt mdp) / durée de la session
if ($diff > $this->securityPolicy['passwordValidity']) {
throw \laabs::newException('auth/userPasswordValidityExpiredRequestException');
......
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