From b859b67fea3f4a52682c86fe4436f2cda0205247 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 8 Jan 2013 18:07:22 +0100 Subject: [PATCH] Improve LogoutAction --- .../lib/acp/action/LogoutAction.class.php | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/wcfsetup/install/files/lib/acp/action/LogoutAction.class.php b/wcfsetup/install/files/lib/acp/action/LogoutAction.class.php index ed8d5646b5..9053d45ca6 100755 --- a/wcfsetup/install/files/lib/acp/action/LogoutAction.class.php +++ b/wcfsetup/install/files/lib/acp/action/LogoutAction.class.php @@ -1,8 +1,7 @@ * @package com.woltlab.wcf * @subpackage acp.action * @category Community Framework */ class LogoutAction extends AbstractSecureAction { + /** + * @see wcf\action\AbstractAction::$loginRequired + */ + public $loginRequired = true; + /** * @see wcf\action\IAction::execute() */ public function execute() { parent::execute(); - - // validate - if (!WCF::getUser()->userID) { - throw new IllegalLinkException(); - } - + // do logout WCF::getSession()->delete(); @@ -35,9 +34,7 @@ class LogoutAction extends AbstractSecureAction { // forward to index page // warning: if doLogout() writes a cookie this is buggy in MS IIS - $application = ApplicationHandler::getInstance()->getActiveApplication(); - $path = $application->getPageURL() . 'acp/index.php' . SID_ARG_1ST; - HeaderUtil::redirect($path); + HeaderUtil::redirect(LinkHandler::getInstance()->getLink('Login')); exit; } } -- 2.20.1