diff --git a/src/DI.php b/src/DI.php index e328a1fdd3..485b1b799d 100644 --- a/src/DI.php +++ b/src/DI.php @@ -28,6 +28,7 @@ use Psr\Log\LoggerInterface; * @method static Core\Process process() * @method static Core\Session\ISession session() * @method static Database\Database dba() + * @method static Model\User\Cookie cookie() * @method static Model\Notify notify() * @method static Model\Introduction intro() * @method static Protocol\Activity activity() @@ -61,6 +62,7 @@ abstract class DI 'process' => Core\Process::class, 'session' => Core\Session\ISession::class, 'dba' => Database\Database::class, + 'cookie' => Model\User\Cookie::class, 'notify' => Model\Notify::class, 'intro' => Model\Introduction::class, 'activity' => Protocol\Activity::class, diff --git a/src/Module/Security/Logout.php b/src/Module/Security/Logout.php index abe409ca1d..3cbbd4933f 100644 --- a/src/Module/Security/Logout.php +++ b/src/Module/Security/Logout.php @@ -6,11 +6,7 @@ namespace Friendica\Module\Security; use Friendica\BaseModule; -use Friendica\App\Authentication; -use Friendica\Core\Cache; use Friendica\Core\Hook; -use Friendica\Core\L10n; -use Friendica\Core\Session; use Friendica\Core\System; use Friendica\DI; use Friendica\Model\Profile; @@ -30,16 +26,17 @@ class Logout extends BaseModule $visitor_home = null; if (remote_user()) { $visitor_home = Profile::getMyURL(); - Cache::delete('zrlInit:' . $visitor_home); + DI::cache()->delete('zrlInit:' . $visitor_home); } Hook::callAll("logging_out"); - Session::clear(); + DI::cookie()->clear(); + DI::session()->clear(); if ($visitor_home) { System::externalRedirect($visitor_home); } else { - info(L10n::t('Logged out.')); + info(DI::l10n()->t('Logged out.')); DI::baseUrl()->redirect(); } }