本文整理汇总了PHP中XenForo_Helper_Cookie::deleteAllCookies方法的典型用法代码示例。如果您正苦于以下问题:PHP XenForo_Helper_Cookie::deleteAllCookies方法的具体用法?PHP XenForo_Helper_Cookie::deleteAllCookies怎么用?PHP XenForo_Helper_Cookie::deleteAllCookies使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XenForo_Helper_Cookie
的用法示例。
在下文中一共展示了XenForo_Helper_Cookie::deleteAllCookies方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionIndex
/**
* Single-stage logout procedure
*/
public function actionIndex()
{
$csrfToken = $this->_input->filterSingle('_xfToken', XenForo_Input::STRING);
$redirectResponse = $this->responseRedirect(XenForo_ControllerResponse_Redirect::SUCCESS, $this->getDynamicRedirect(false, false));
$userId = XenForo_Visitor::getUserId();
if (!$userId) {
return $redirectResponse;
}
if ($this->_noRedirect() || !$csrfToken) {
// request is likely from JSON, probably XenForo.OverlayTrigger, so show a confirmation dialog
return $this->responseView('XenForo_ViewPublic_LogOut', 'log_out');
} else {
$this->_checkCsrfFromToken($csrfToken);
// remove an admin session if we're logged in as the same person
if (XenForo_Visitor::getInstance()->get('is_admin')) {
$class = XenForo_Application::resolveDynamicClass('XenForo_Session');
$adminSession = new $class(array('admin' => true));
$adminSession->start();
if ($adminSession->get('user_id') == $userId) {
$adminSession->delete();
}
}
$this->getModelFromCache('XenForo_Model_Session')->processLastActivityUpdateForLogOut(XenForo_Visitor::getUserId());
XenForo_Application::get('session')->delete();
XenForo_Helper_Cookie::deleteAllCookies($this->_getRetainedCookies(), array('user' => array('httpOnly' => false)));
XenForo_Visitor::setup(0);
return $redirectResponse;
}
}
示例2: actionIndex
/**
* 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'));
}
示例3: logout
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);
}
示例4: logout
public function logout()
{
// Check if we are an admin
if ($this->getVisitor()->get('is_admin')) {
// Logout admin
$this->adminLogout();
}
// Logout user
XenForo_Model::create('XenForo_Model_Session')->processLastActivityUpdateForLogOut($this->getVisitor()->getUserId());
$this->getSession()->delete();
XenForo_Helper_Cookie::deleteAllCookies(array('session'), array('user' => array('httpOnly' => false)));
$this->getVisitor()->setup(0);
return true;
}
示例5: actionLogout
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);
}