2018-02-09 04:49:49 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @file src/Module/Logout.php
|
|
|
|
*/
|
2018-12-26 07:06:24 +01:00
|
|
|
|
2018-02-09 04:49:49 +01:00
|
|
|
namespace Friendica\Module;
|
|
|
|
|
|
|
|
use Friendica\BaseModule;
|
2018-10-17 14:19:58 +02:00
|
|
|
use Friendica\Core\Authentication;
|
2018-12-26 07:06:24 +01:00
|
|
|
use Friendica\Core\Hook;
|
2018-02-09 04:49:49 +01:00
|
|
|
use Friendica\Core\L10n;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Logout module
|
|
|
|
*
|
2018-09-16 01:28:38 +02:00
|
|
|
* @author Hypolite Petovan <hypolite@mrpetovan.com>
|
2018-02-09 04:49:49 +01:00
|
|
|
*/
|
|
|
|
class Logout extends BaseModule
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @brief Process logout requests
|
|
|
|
*/
|
|
|
|
public static function init()
|
|
|
|
{
|
2018-12-26 07:06:24 +01:00
|
|
|
Hook::callAll("logging_out");
|
2018-10-17 21:30:41 +02:00
|
|
|
Authentication::deleteSession();
|
2018-02-09 04:49:49 +01:00
|
|
|
info(L10n::t('Logged out.') . EOL);
|
2018-10-19 20:11:27 +02:00
|
|
|
self::getApp()->internalRedirect();
|
2018-02-09 04:49:49 +01:00
|
|
|
}
|
|
|
|
}
|