コード例 #1
0
ファイル: user.php プロジェクト: nsbasicus/warden
 /**
  * Lock a user setting it's locked_at to actual time.
  *
  * @return bool
  */
 public function lock_access()
 {
     $this->locked_at = \Date::time('UTC')->format('mysql');
     if ($this->is_unlock_strategy_enabled('email')) {
         $this->generate_unlock_token();
     }
     // Revoke authentication token
     $this->authentication_token = null;
     // Save and make sure session is destroyed completely
     if ($this->save(false) && Warden::logout(true)) {
         // Only send instructions after token was saved successfully
         if ($this->is_unlock_strategy_enabled('email')) {
             return $this->send_unlock_instructions();
         }
         return true;
     }
     return false;
 }
コード例 #2
0
 public function action_logout()
 {
     Warden::logout();
     Response::redirect('/welcome');
 }