From 4caeb7fbad615421f5ee02e91506658964048644 Mon Sep 17 00:00:00 2001 From: blackcoder87 Date: Wed, 4 Dec 2024 16:57:34 +0100 Subject: [PATCH] Remove unused parameter (#1135) --- application/modules/user/controllers/Login.php | 2 +- application/modules/user/service/Login.php | 5 +++-- application/modules/user/service/Remember.php | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/application/modules/user/controllers/Login.php b/application/modules/user/controllers/Login.php index d38619a64..8262a6913 100644 --- a/application/modules/user/controllers/Login.php +++ b/application/modules/user/controllers/Login.php @@ -42,7 +42,7 @@ public function indexAction() $userMapper = new UserMapper(); $userMapper->deleteselectsdelete(($this->getConfig()->get('userdeletetime'))); - $result = LoginService::factory()->perform($this->getRequest()->getPost('login_emailname'), $this->getRequest()->getPost('login_password'), (bool)$this->getRequest()->getPost('rememberMe', 0)); + $result = LoginService::factory()->perform($this->getRequest()->getPost('login_emailname'), $this->getRequest()->getPost('login_password')); if ($result->isSuccessful()) { $cookieStolenMapper = new CookieStolenMapper(); diff --git a/application/modules/user/service/Login.php b/application/modules/user/service/Login.php index e63edf43b..b3aeb0c0e 100644 --- a/application/modules/user/service/Login.php +++ b/application/modules/user/service/Login.php @@ -7,6 +7,7 @@ namespace Modules\User\Service; +use Ilch\Database\Exception; use Modules\User\Mappers\User as UserMapper; use Modules\User\Service\Login\Result as LoginResult; @@ -45,10 +46,10 @@ public function __construct(UserMapper $mapper, Password $passwordService) * Performs the Login for a User * @param string $userNameOrEmail * @param string $password - * @param bool $remember * @return LoginResult + * @throws Exception */ - public function perform(string $userNameOrEmail, string $password, bool $remember = false): LoginResult + public function perform(string $userNameOrEmail, string $password): LoginResult { $user = $this->mapper->getUserByEmail($userNameOrEmail); diff --git a/application/modules/user/service/Remember.php b/application/modules/user/service/Remember.php index a8be105c2..dea54dc40 100644 --- a/application/modules/user/service/Remember.php +++ b/application/modules/user/service/Remember.php @@ -22,7 +22,7 @@ class Remember * @throws \Exception * @since 2.1.38 */ - public function rememberMe($userId) + public function rememberMe(int $userId) { $authTokenModel = new AuthTokenModel(); @@ -36,7 +36,7 @@ public function rememberMe($userId) $authTokenModel->setUserid($userId); $authTokenModel->setExpires(date('Y-m-d\TH:i:s', strtotime('+30 days'))); - setcookieIlch('remember', $authTokenModel->getSelector().':'.base64_encode($authenticator), strtotime('+30 days')); + setcookieIlch('remember', $authTokenModel->getSelector() . ':' . base64_encode($authenticator), strtotime('+30 days')); $authTokenMapper = new AuthTokenMapper(); $authTokenMapper->addAuthToken($authTokenModel); @@ -74,7 +74,7 @@ public function reauthenticate() $authTokenModel->setUserid($_SESSION['user_id']); $authTokenModel->setExpires(date('Y-m-d\TH:i:s', strtotime('+30 days'))); - setcookieIlch('remember', $authTokenModel->getSelector().':'.base64_encode($authenticator), strtotime('+30 days')); + setcookieIlch('remember', $authTokenModel->getSelector() . ':' . base64_encode($authenticator), strtotime('+30 days')); $authTokenMapper->updateAuthToken($authTokenModel); } else {