Merge pull request #6054 from christianbeeznest/fixes-updates61

User: Update last_login on user login
pull/6057/head
christianbeeznest 8 months ago committed by GitHub
commit 71af7349b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      src/CoreBundle/EventListener/LoginSuccessHandler.php

@ -144,6 +144,10 @@ class LoginSuccessHandler
$trackELoginRepository->createLoginRecord($user, new DateTime(), $userIp);
$trackEOnlineRepository->createOnlineSession($user, $userIp);
$user->setLastLogin(new DateTime());
$this->entityManager->persist($user);
$this->entityManager->flush();
// Log of connection attempts
$trackELoginRecordRepository->addTrackLogin($user->getUsername(), $userIp, true);
$this->loginAttemptLogger->logAttempt(true, $user->getUsername(), $userIp);

Loading…
Cancel
Save