Beispiel #1
0
 /**
  * Single-stage logout procedure
  */
 public function actionIndex()
 {
     $this->_checkCsrfFromToken($this->_input->filterSingle('_xfToken', XenForo_Input::STRING));
     // remove an admin session if we're logged in as the same person
     if (XenForo_Visitor::getInstance()->get('is_admin')) {
         $adminSession = new XenForo_Session(array('admin' => true));
         $adminSession->start();
         if ($adminSession->get('user_id') == XenForo_Visitor::getUserId()) {
             $adminSession->delete();
         }
     }
     $this->getModelFromCache('XenForo_Model_Session')->processLastActivityUpdateForLogOut(XenForo_Visitor::getUserId());
     XenForo_Application::get('session')->delete();
     XenForo_Helper_Cookie::deleteAllCookies(array('session'), array('user' => array('httpOnly' => false)));
     XenForo_Visitor::setup(0);
     $redirect = $this->_input->filterSingle('redirect', XenForo_Input::STRING);
     return $this->responseRedirect(XenForo_ControllerResponse_Redirect::SUCCESS, $redirect ? $redirect : XenForo_Link::buildPublicLink('index'));
 }
Beispiel #2
0
 public static function logout()
 {
     self::start();
     if (!self::userLoad()) {
         return;
     }
     if (XenForo_Visitor::getInstance()->get('is_admin')) {
         $adminSession = new XenForo_Session(array('admin' => true));
         $adminSession->start();
         if ($adminSession->get('user_id') == XenForo_Visitor::getUserId()) {
             $adminSession->delete();
         }
     }
     XenForo_Model::create('XenForo_Model_Session')->processLastActivityUpdateForLogOut(XenForo_Visitor::getUserId());
     XenForo_Application::get('session')->delete();
     XenForo_Helper_Cookie::deleteAllCookies(array('session'), array('user' => array('httpOnly' => false)));
     XenForo_Visitor::setup(0);
 }
Beispiel #3
0
 public function adminLogout()
 {
     $session = new XenForo_Session(array('admin' => true));
     $session->start();
     if ($session->get('user_id') == $this->getVisitor()->getUserId()) {
         return $session->delete();
     }
     return true;
 }
Beispiel #4
0
 public function actionLogout()
 {
     $fr_username = $this->_input->filterSingle('fr_username', XenForo_Input::STRING);
     if (XenForo_Visitor::getInstance()->get('is_admin')) {
         $admin = new XenForo_Session(array('admin' => true));
         $admin->start();
         if ($admin->get('user_id') == XenForo_Visitor::getUserId()) {
             $admin->delete();
         }
     }
     fr_remove_push_user();
     $this->getModelFromCache('XenForo_Model_Session')->processLastActivityUpdateForLogOut(XenForo_Visitor::getUserId());
     XenForo_Application::get('session')->delete();
     XenForo_Helper_Cookie::deleteAllCookies(array('session'), array('user' => array('httpOnly' => false)));
     XenForo_Visitor::setup(0);
     $requires_authentication = false;
     if (!XenForo_Visitor::getInstance()->hasPermission('general', 'view')) {
         $requires_authentication = true;
     }
     $options = XenForo_Application::get('options');
     if (!$options->boardActive) {
         $requires_authentication = true;
     }
     return array('success' => true, 'requires_authentication' => $requires_authentication);
 }