示例#1
0
 /**
  * Detects if there is concurrent session (i.e. another user logged in with the same current user credentials),
  * If so, then logout.
  */
 public static function checkSessionConcurrency()
 {
     if (Session::userIsLoggedIn()) {
         if (Session::isConcurrentSessionExists()) {
             \Huge\Model\LoginModel::logout();
             Redirect::home();
             Application::stop();
         }
     }
 }
示例#2
0
 /**
  * Edit user name (perform the real action after form has been submitted)
  */
 public function editUsername_action()
 {
     // check if csrf token is valid
     if (!Csrf::isTokenValid()) {
         LoginModel::logout();
         Redirect::home();
         \Huge\Core\Application::stop();
     }
     UserModel::editUserName(Request::post('user_name'));
     Redirect::to('user/editUsername');
 }
 /**
  * The logout action
  * Perform logout, redirect user to main-page
  */
 public function logout()
 {
     LoginModel::logout();
     Redirect::home();
     \Huge\Core\Application::stop();
 }