mirror of
https://github.com/friendica/friendica
synced 2025-04-20 17:10:10 +00:00
UserSession class [5] - Refactor src/Module/ files with DI
This commit is contained in:
parent
a729f3255d
commit
eecc456e0c
78 changed files with 455 additions and 530 deletions
|
@ -22,7 +22,6 @@
|
|||
namespace Friendica\Module\Debug;
|
||||
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\Core\Session;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Post;
|
||||
|
@ -35,7 +34,7 @@ class ItemBody extends BaseModule
|
|||
{
|
||||
protected function content(array $request = []): string
|
||||
{
|
||||
if (!Session::getLocalUser()) {
|
||||
if (!DI::userSession()->getLocalUserId()) {
|
||||
throw new HTTPException\UnauthorizedException(DI::l10n()->t('Access denied.'));
|
||||
}
|
||||
|
||||
|
@ -45,7 +44,7 @@ class ItemBody extends BaseModule
|
|||
|
||||
$itemId = intval($this->parameters['item']);
|
||||
|
||||
$item = Post::selectFirst(['body'], ['uid' => [0, Session::getLocalUser()], 'uri-id' => $itemId]);
|
||||
$item = Post::selectFirst(['body'], ['uid' => [0, DI::userSession()->getLocalUserId()], 'uri-id' => $itemId]);
|
||||
|
||||
if (!empty($item)) {
|
||||
if (DI::mode()->isAjax()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue