mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-11 13:44:26 +02: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
|
@ -25,7 +25,6 @@ use Friendica\Content\Nav;
|
|||
use Friendica\Content\Pager;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\Session;
|
||||
use Friendica\Module;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Contact;
|
||||
|
@ -37,7 +36,7 @@ class Common extends BaseProfile
|
|||
{
|
||||
protected function content(array $request = []): string
|
||||
{
|
||||
if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
|
||||
if (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) {
|
||||
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
|
||||
}
|
||||
|
||||
|
@ -56,7 +55,7 @@ class Common extends BaseProfile
|
|||
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
|
||||
}
|
||||
|
||||
$displayCommonTab = Session::isAuthenticated() && $profile['uid'] != Session::getLocalUser();
|
||||
$displayCommonTab = DI::userSession()->isAuthenticated() && $profile['uid'] != DI::userSession()->getLocalUserId();
|
||||
|
||||
if (!$displayCommonTab) {
|
||||
$a->redirect('profile/' . $nickname . '/contacts');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue