Commit | Line | Data |
---|---|---|
320f4a6d MW |
1 | <?php |
2 | namespace wcf\action; | |
3 | use wcf\system\request\LinkHandler; | |
4 | use wcf\system\WCF; | |
5 | use wcf\util\HeaderUtil; | |
6 | ||
7 | /** | |
8 | * Does the user logout. | |
9 | * | |
10 | * @author Marcel Werk | |
c839bd49 | 11 | * @copyright 2001-2018 WoltLab GmbH |
320f4a6d | 12 | * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> |
e71525e4 | 13 | * @package WoltLabSuite\Core\Action |
320f4a6d MW |
14 | */ |
15 | class LogoutAction extends \wcf\acp\action\LogoutAction { | |
16 | const AVAILABLE_DURING_OFFLINE_MODE = true; | |
17 | ||
18 | /** | |
0fcfe5f6 | 19 | * @inheritDoc |
320f4a6d MW |
20 | */ |
21 | public function execute() { | |
22 | AbstractSecureAction::execute(); | |
23 | ||
24 | // do logout | |
25 | WCF::getSession()->delete(); | |
26 | ||
27 | // remove cookies | |
28 | if (isset($_COOKIE[COOKIE_PREFIX.'userID'])) { | |
29 | HeaderUtil::setCookie('userID', 0); | |
30 | } | |
31 | if (isset($_COOKIE[COOKIE_PREFIX.'password'])) { | |
32 | HeaderUtil::setCookie('password', ''); | |
33 | } | |
34 | ||
35 | $this->executed(); | |
36 | ||
37 | // forward to index page | |
06edbf27 | 38 | HeaderUtil::redirect(LinkHandler::getInstance()->getLink()); |
320f4a6d MW |
39 | exit; |
40 | } | |
41 | } |