UserSession class [6] - Refactor src/Module/ files without DI

This commit is contained in:
Philipp 2022-10-20 23:35:01 +02:00
parent bf39b5a948
commit 22198ea495
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
8 changed files with 74 additions and 38 deletions

View file

@ -28,7 +28,7 @@ use Friendica\BaseModule;
use Friendica\Content\Pager;
use Friendica\Core\L10n;
use Friendica\Core\Renderer;
use Friendica\Core\Session;
use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Core\System;
use Friendica\Navigation\Notifications\ValueObject\FormattedNotify;
use Friendica\Network\HTTPException\ForbiddenException;
@ -90,11 +90,11 @@ abstract class BaseNotifications extends BaseModule
*/
abstract public function getNotifications();
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $userSession, array $server, array $parameters = [])
{
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
if (!Session::getLocalUser()) {
if (!$userSession->getLocalUserId()) {
throw new ForbiddenException($this->t('Permission denied.'));
}