Example #1
0
 /**
  * After that user is logged-in
  * @param AdminUser $user
  * @return string session id
  */
 public function setUserLoggedIn($user)
 {
     $_SESSION['admin_logged'] = true;
     $_SESSION['admin_id'] = $user->getId();
     $_SESSION['admin_login'] = $user->getLogin();
     $_SESSION['admin_sid'] = Users::getInstance()->startSession($user->getId());
     if (!defined('USER_ID')) {
         define('USER_ID', $user->getId());
     }
     App::add('User "' . $user->getLogin() . '" logged in.');
 }
Example #2
0
 /**
  * @param AdminUser $user
  */
 private function initLogInProcess($user)
 {
     $user->loadDataFromDB();
     // Set constants and session
     Users::getInstance()->deleteSession($user->getId());
     Users::getInstance()->setUserLoggedIn($user);
     go(isset($_POST['go']) ? $_POST['go'] : '/cms/?p=home');
 }