Beispiel #1
0
 public function markread()
 {
     Container::get('hooks')->fire('controller.index.markread');
     Auth::set_last_visit(User::get()->id, User::get()->logged);
     // Reset tracked topics
     Track::set_tracked_topics(null);
     return Router::redirect(Router::pathFor('home'), __('Mark read redirect'));
 }
Beispiel #2
0
 public function logout($token)
 {
     $token = $this->feather->hooks->fire('logout_start', $token);
     if ($this->feather->user->is_guest || !isset($token) || $token != Random::hash($this->feather->user->id . Random::hash($this->feather->request->getIp()))) {
         Url::redirect($this->feather->urlFor('home'), 'Not logged in');
     }
     ModelAuth::delete_online_by_id($this->feather->user->id);
     // Update last_visit (make sure there's something to update it with)
     if (isset($this->feather->user->logged)) {
         ModelAuth::set_last_visit($this->feather->user->id, $this->feather->user->logged);
     }
     ModelAuth::feather_setcookie(1, Random::hash(uniqid(rand(), true)), time() + 31536000);
     $this->feather->hooks->fire('logout_end');
     Url::redirect($this->feather->urlFor('home'), __('Logout redirect'));
 }
Beispiel #3
0
 public function logout($req, $res, $args)
 {
     $token = Container::get('hooks')->fire('controller.logout', $args['token']);
     if (User::get()->is_guest || !isset($token) || $token != Random::hash(User::get()->id . Random::hash(Utils::getIp()))) {
         return Router::redirect(Router::pathFor('home'), 'Not logged in');
     }
     ModelAuth::delete_online_by_id(User::get()->id);
     // Update last_visit (make sure there's something to update it with)
     if (isset(User::get()->logged)) {
         ModelAuth::set_last_visit(User::get()->id, User::get()->logged);
     }
     ModelAuth::feather_setcookie('Bearer ', 1);
     Container::get('hooks')->fire('controller.logout_end');
     return Router::redirect(Router::pathFor('home'), __('Logout redirect'));
 }