X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=inline;f=src%2FModule%2FLogout.php;h=49ede01a3d7a1544c32417ff1606ec36a6ff0cdd;hb=d01d69b9e72360b0b19c2618b3c3504704ea83da;hp=cbfd245f302f47f276cff27f8ee1ab1e192d0459;hpb=5a02e39a65f8f685440228cc1d36738cbe15f32b;p=friendica.git diff --git a/src/Module/Logout.php b/src/Module/Logout.php index cbfd245f30..49ede01a3d 100644 --- a/src/Module/Logout.php +++ b/src/Module/Logout.php @@ -2,14 +2,16 @@ /** * @file src/Module/Logout.php */ + namespace Friendica\Module; use Friendica\BaseModule; -use Friendica\Core\Addon; +use Friendica\Core\Authentication; +use Friendica\Core\Cache; +use Friendica\Core\Hook; use Friendica\Core\L10n; - -require_once 'boot.php'; -require_once 'include/security.php'; +use Friendica\Core\System; +use Friendica\Model\Profile; /** * Logout module @@ -21,11 +23,22 @@ class Logout extends BaseModule /** * @brief Process logout requests */ - public static function init() + public static function init(array $parameters = []) { - Addon::callHooks("logging_out"); - nuke_session(); - info(L10n::t('Logged out.') . EOL); - goaway(self::getApp()->getBaseURL()); + $visitor_home = null; + if (remote_user()) { + $visitor_home = Profile::getMyURL(); + Cache::delete('zrlInit:' . $visitor_home); + } + + Hook::callAll("logging_out"); + Authentication::deleteSession(); + + if ($visitor_home) { + System::externalRedirect($visitor_home); + } else { + info(L10n::t('Logged out.')); + self::getApp()->internalRedirect(); + } } }