X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FLogout.php;h=bf6a39e19f961a55a38a64b2e9d8ee5a4ecaa77c;hb=1c8dd457cc0676e9f1079f1b7c7fcbb740978930;hp=b2c03bf91fd0c4c3645c0d6500159c7db00e5212;hpb=45e5a7f59ff9ee5f088d4b3eef6f989c9876d083;p=friendica.git diff --git a/src/Module/Logout.php b/src/Module/Logout.php index b2c03bf91f..bf6a39e19f 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'; +use Friendica\Core\System; +use Friendica\Model\Profile; /** * Logout module @@ -23,9 +25,20 @@ class Logout extends BaseModule */ public static function init() { - Addon::callHooks("logging_out"); - Authentication::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(); + } } }