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