From 3d8c4c747d1f8cc249f8bba2da68097dfa9a73b8 Mon Sep 17 00:00:00 2001 From: niciz Date: Tue, 21 Nov 2023 14:19:17 +0100 Subject: [PATCH 1/3] Update PasswordExpireService.php Fix PasswordExpireService return error when user model attribute "password_changed_at" is already set at null. --- src/User/Service/PasswordExpireService.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/User/Service/PasswordExpireService.php b/src/User/Service/PasswordExpireService.php index bfec3f7c..77470450 100644 --- a/src/User/Service/PasswordExpireService.php +++ b/src/User/Service/PasswordExpireService.php @@ -25,8 +25,11 @@ public function __construct(User $model) public function run() { - return $this->model->updateAttributes([ - 'password_changed_at' => null, - ]); + if ($this->model->password_changed_at !== null) { + return $this->model->updateAttributes([ + 'password_changed_at' => null, + ]); + } + return true; } } From 2ca349964f32157cabeec349091c87a79171ac33 Mon Sep 17 00:00:00 2001 From: niciz Date: Fri, 15 Dec 2023 13:54:27 +0100 Subject: [PATCH 2/3] Update PasswordExpireService.php remove useless if statement --- src/User/Service/PasswordExpireService.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/User/Service/PasswordExpireService.php b/src/User/Service/PasswordExpireService.php index 77470450..38190e58 100644 --- a/src/User/Service/PasswordExpireService.php +++ b/src/User/Service/PasswordExpireService.php @@ -25,11 +25,9 @@ public function __construct(User $model) public function run() { - if ($this->model->password_changed_at !== null) { - return $this->model->updateAttributes([ - 'password_changed_at' => null, - ]); - } + $this->model->updateAttributes([ + 'password_changed_at' => null, + ]); return true; } } From d46bff1195e3891b762bf1a1a9b048489ae867d3 Mon Sep 17 00:00:00 2001 From: niciz Date: Fri, 15 Dec 2023 18:33:24 +0100 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63dfca19..b1aa6634 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Fix: update Dutch (nl) translations (squio) - Enh: possibility to limit the depth of the recursion when getting user ids from roles (mp1509) - Fix: UserSearch avoid fields name conflict if joined with other tables (liviuk2) +- Fix: PasswordExpireService return false when user model attribute "password_changed_at" is already set at null. ## 1.6.1 March 4th, 2023