From e36176f7ddd7f66f478a709ce15cfa6c2b78ba93 Mon Sep 17 00:00:00 2001 From: "Nicholas K. Dionysopoulos" Date: Sat, 9 Nov 2024 15:55:24 +0200 Subject: [PATCH] # [MEDIUM] PHP error trying to log in with a username that doesn't exist Signed-off-by: Nicholas K. Dionysopoulos --- CHANGELOG | 4 ++++ src/Model/Login.php | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index de2c8124..d180e277 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,8 @@ +Akeeba Panopticon 1.3.1 +================================================================================ +# [MEDIUM] PHP error trying to log in with a username that doesn't exist + Akeeba Panopticon 1.3.0 ================================================================================ + Domain registration and expiration warnings diff --git a/src/Model/Login.php b/src/Model/Login.php index 86b84854..09b6bae8 100644 --- a/src/Model/Login.php +++ b/src/Model/Login.php @@ -34,7 +34,7 @@ public function canUserLoginWithPassword(?string $username): bool $user = $this->getContainer()->userManager->getUserByUsername($username); // If the user was not found we return a fake "true" so that the regular login process records a fail. - if (!$user->getId()) + if (empty($user) || !$user->getId()) { return true; } @@ -69,7 +69,7 @@ public function resetPasswordResetRequests(): void $userManager = $this->getContainer()->userManager; $user = $userManager->getUser(); - if (!$user->getId()) + if (empty($user) || !$user->getId()) { return; }