Archived
1
0
Fork 0

app/library/Auth.php: Adding getImpersonator()

This commit is contained in:
Henrik Hautakoski 2023-04-30 18:04:35 +02:00
parent 6dc1d0fb87
commit bf940f9523

View file

@ -87,6 +87,12 @@ class Auth extends Injectable
$this->eventsManager->fire('auth:onLogin', $this, 'System');
}
public function getImpersonator()
{
$id = $this->session->get(self::IMPERSONATOR_ID);
return $id !== null ? User::findFirst($id) : null;
}
/**
* Impersonate a user
*