2018-02-08 22:49:49 -05:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @file src/Module/Logout.php
|
|
|
|
*/
|
|
|
|
namespace Friendica\Module;
|
|
|
|
|
|
|
|
use Friendica\BaseModule;
|
|
|
|
use Friendica\Core\Addon;
|
2018-10-17 08:19:58 -04:00
|
|
|
use Friendica\Core\Authentication;
|
2018-02-08 22:49:49 -05:00
|
|
|
use Friendica\Core\L10n;
|
2018-10-13 14:02:04 -04:00
|
|
|
use Friendica\Core\System;
|
2018-02-08 22:49:49 -05:00
|
|
|
|
|
|
|
require_once 'boot.php';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Logout module
|
|
|
|
*
|
2018-09-15 19:28:38 -04:00
|
|
|
* @author Hypolite Petovan <hypolite@mrpetovan.com>
|
2018-02-08 22:49:49 -05:00
|
|
|
*/
|
|
|
|
class Logout extends BaseModule
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @brief Process logout requests
|
|
|
|
*/
|
|
|
|
public static function init()
|
|
|
|
{
|
|
|
|
Addon::callHooks("logging_out");
|
2018-10-17 15:30:41 -04:00
|
|
|
Authentication::deleteSession();
|
2018-02-08 22:49:49 -05:00
|
|
|
info(L10n::t('Logged out.') . EOL);
|
2018-10-13 14:02:04 -04:00
|
|
|
self::getApp()->redirect();
|
2018-02-08 22:49:49 -05:00
|
|
|
}
|
|
|
|
}
|