Esempio n. 1
0
 /**
  *
  */
 public function action_logout()
 {
     if (!\Registry::getCurrentUser()->isGuest()) {
         \Auth\Base::destroy();
     }
     \HTTP::redirect(\Route::get('SystemRoute')->uri(['controller' => 'Main', 'action' => 'Login']), 302);
 }
Esempio n. 2
0
 /**
  * @return bool
  */
 public function action_logout()
 {
     header('Content-type: application/json');
     $t = \Auth\Base::destroy();
     if ($t) {
         $this->response->body(json_encode(['code' => 1]));
     } else {
         $this->response->body(json_encode(['code' => 0]));
     }
 }