| Conditions | 4 |
| Paths | 4 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 44 | public function onInteractiveLogin(InteractiveLoginEvent $event) |
||
| 45 | { |
||
| 46 | $token = $event->getAuthenticationToken(); |
||
| 47 | |||
| 48 | if (!$token instanceof TokenInterface) { |
||
| 49 | return; |
||
| 50 | } |
||
| 51 | |||
| 52 | $user = $token->getUser(); |
||
| 53 | |||
| 54 | if (!$user instanceof LastLoginInterface) { |
||
| 55 | return; |
||
| 56 | } |
||
| 57 | |||
| 58 | // Impersonnate user must not update last_login date |
||
| 59 | if ($event->getRequest()->get('switch_user') !== null) { |
||
| 60 | return; |
||
| 61 | } |
||
| 62 | |||
| 63 | $this->lastLoginProcessor->process($user); |
||
| 64 | } |
||
| 65 | } |
||
| 66 |