]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Profile/Common.php
Merge branch 'develop' into new_image_presentation
[friendica.git] / src / Module / Profile / Common.php
index a46973967989b346a3c8984efaad7d051c9c6b1c..5056758603814f450de00c962817a804b6bf863f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -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;
@@ -35,9 +34,9 @@ use Friendica\Network\HTTPException;
 
 class Common extends BaseProfile
 {
-       public static function content()
+       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.'));
                }
 
@@ -45,7 +44,7 @@ class Common extends BaseProfile
 
                Nav::setSelected('home');
 
-               $nickname = static::$parameters['nickname'];
+               $nickname = $this->parameters['nickname'];
 
                $profile = Profile::load($a, $nickname);
                if (empty($profile)) {
@@ -56,13 +55,13 @@ class Common extends BaseProfile
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
                }
 
-               $displayCommonTab = Session::isAuthenticated() && $profile['uid'] != local_user();
+               $displayCommonTab = DI::userSession()->isAuthenticated() && $profile['uid'] != DI::userSession()->getLocalUserId();
 
                if (!$displayCommonTab) {
                        $a->redirect('profile/' . $nickname . '/contacts');
                };
 
-               $o = self::getTabsHTML($a, 'contacts', false, $profile['nickname'], $profile['hide-friends']);
+               $o = self::getTabsHTML('contacts', false, $profile['nickname'], $profile['hide-friends']);
 
                $tabs = self::getContactFilterTabs('profile/' . $nickname, 'common', $displayCommonTab);