| 1 | <?php |
| 2 | |
| 3 | namespace wcf\action; |
| 4 | |
| 5 | use Laminas\Diactoros\Response\RedirectResponse; |
| 6 | use wcf\system\request\LinkHandler; |
| 7 | use wcf\system\WCF; |
| 8 | |
| 9 | /** |
| 10 | * Does the user logout. |
| 11 | * |
| 12 | * @author Marcel Werk |
| 13 | * @copyright 2001-2019 WoltLab GmbH |
| 14 | * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> |
| 15 | */ |
| 16 | class LogoutAction extends \wcf\acp\action\LogoutAction |
| 17 | { |
| 18 | const AVAILABLE_DURING_OFFLINE_MODE = true; |
| 19 | |
| 20 | /** |
| 21 | * @inheritDoc |
| 22 | */ |
| 23 | public function execute() |
| 24 | { |
| 25 | AbstractSecureAction::execute(); |
| 26 | |
| 27 | WCF::getSession()->delete(); |
| 28 | |
| 29 | $this->executed(); |
| 30 | |
| 31 | return new RedirectResponse( |
| 32 | LinkHandler::getInstance()->getLink() |
| 33 | ); |
| 34 | } |
| 35 | } |