Beispiel #1
0
 public static function setUser(User $user)
 {
     self::$currentUser = $user;
     $app = ActiveRecordModel::getApplication();
     $app->processRuntimePlugins('session/before-login');
     $session = new Session();
     $session->set('User', $user->getID());
     $session->set('UserGroup', $user->userGroup->get() ? $user->userGroup->get()->getID() : 0);
     if ($app->getSessionHandler()) {
         $app->getSessionHandler()->setUser($user);
     }
     $app->processRuntimePlugins('session/login');
 }