From 31d5740681803f771c57fe18d8f65de6255b6a47 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Tue, 14 Aug 2018 20:35:23 +0200 Subject: [PATCH] app/library/Auth.php: adding systemLogin() --- app/library/Auth.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/library/Auth.php b/app/library/Auth.php index 9afb5c0..f319c3c 100644 --- a/app/library/Auth.php +++ b/app/library/Auth.php @@ -71,6 +71,17 @@ class Auth extends Component return true; } + /** + * The system logs in a user (without credentials). + * + * @param User $user + */ + public function systemLogin(User $user) + { + $this->setIdentity($user->getId()); + $this->eventsManager->fire('auth:onLogin', $this, 'System'); + } + /** * @param $identity * @return Auth