Files
typecho/var/Widget/Logout.php
joyqi 4c8c64c79e Feat/code refactor (#1626)
* remove all magic methods, add type for class properties

* refactor codes

* fix all

* refactor code

* fix type

* fix all

* fix request is method

* fix all

* fix router

* fix get page
2023-09-24 16:21:32 +08:00

38 lines
694 B
PHP

<?php
namespace Widget;
use Widget\Base\Users;
if (!defined('__TYPECHO_ROOT_DIR__')) {
exit;
}
/**
* 登出组件
*
* @category typecho
* @package Widget
* @copyright Copyright (c) 2008 Typecho team (http://www.typecho.org)
* @license GNU General Public License 2.0
*/
class Logout extends Users implements ActionInterface
{
/**
* 初始化函数
*
* @access public
* @return void
*/
public function action()
{
// protect
$this->security->protect();
$this->user->logout();
self::pluginHandle()->call('logout');
@session_destroy();
$this->response->goBack(null, $this->options->index);
}
}