From 3a98e6eb90b669209e87e55752ba420928209c42 Mon Sep 17 00:00:00 2001 From: Tobias Werth Date: Tue, 17 Sep 2024 17:13:15 +0200 Subject: [PATCH] On clicking "Reset login status of all team users" also reset the API login status. --- webapp/src/Controller/Jury/UserController.php | 8 +++++--- webapp/src/Entity/User.php | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/webapp/src/Controller/Jury/UserController.php b/webapp/src/Controller/Jury/UserController.php index 10572a7357..21bb1edd6b 100644 --- a/webapp/src/Controller/Jury/UserController.php +++ b/webapp/src/Controller/Jury/UserController.php @@ -373,9 +373,11 @@ public function resetTeamLoginStatus(Request $request): Response $count = 0; foreach ($teamRole->getUsers() as $user) { /** @var User $user */ - $user->setFirstLogin(null); - $user->setLastLogin(null); - $user->setLastIpAddress(null); + $user + ->setFirstLogin(null) + ->setLastLogin(null) + ->setLastApiLogin(null) + ->setLastIpAddress(null); $count++; } $this->em->flush(); diff --git a/webapp/src/Entity/User.php b/webapp/src/Entity/User.php index 9a3eee4274..65d80db812 100644 --- a/webapp/src/Entity/User.php +++ b/webapp/src/Entity/User.php @@ -250,7 +250,7 @@ public function getLastLoginAsDateTime(): ?DateTime return $this->getLastLogin() ? new DateTime(Utils::absTime($this->getLastLogin())) : null; } - public function setLastApiLogin(string|float $lastApiLogin): User + public function setLastApiLogin(string|float|null $lastApiLogin): User { $this->last_api_login = $lastApiLogin; return $this;