<?php
/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
use Friendica\Core\Cache\Capability\ICanCache;
use Friendica\Core\Hook;
use Friendica\Core\L10n;
-use Friendica\Core\Session\Capability\IHandleSessions;
+use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Core\System;
+use Friendica\DI;
use Friendica\Model\Profile;
use Friendica\Model\User\Cookie;
use Friendica\Module\Response;
protected $cache;
/** @var Cookie */
protected $cookie;
- /** @var IHandleSessions */
+ /** @var IHandleUserSessions */
protected $session;
- public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, ICanCache $cache, Cookie $cookie, IHandleSessions $session, array $server, array $parameters = [])
+ public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, ICanCache $cache, Cookie $cookie, IHandleUserSessions $session, array $server, array $parameters = [])
{
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
protected function rawContent(array $request = [])
{
$visitor_home = null;
- if (remote_user()) {
+ if ($this->session->getRemoteUserId()) {
$visitor_home = Profile::getMyURL();
$this->cache->delete('zrlInit:' . $visitor_home);
}
if ($visitor_home) {
System::externalRedirect($visitor_home);
} else {
- info($this->t('Logged out.'));
+ DI::sysmsg()->addInfo($this->t('Logged out.'));
$this->baseUrl->redirect();
}
}