]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Profile/Photos.php
Remove unused first parameter from BaseProfile::getTabsHTML
[friendica.git] / src / Module / Profile / Photos.php
index 50af6f0e961c34a54fb72dab8c16860308e90770..12c0552b6aa98663b25c1f10f01a29afdbe5178e 100644 (file)
@@ -72,8 +72,8 @@ class Photos extends \Friendica\Module\BaseProfile
                        throw new HttpException\ForbiddenException($this->t('Public access denied.'));
                }
 
-               $owner = User::getOwnerDataByNick($this->parameters['nickname']);
-               if (!isset($owner['account_removed']) || $owner['account_removed']) {
+               $owner = Profile::load($this->app, $this->parameters['nickname'] ?? '');
+               if (!$owner || $owner['account_removed'] || $owner['account_expired']) {
                        throw new HTTPException\NotFoundException($this->t('User not found.'));
                }
 
@@ -88,8 +88,8 @@ class Photos extends \Friendica\Module\BaseProfile
                        $remote_contact = $contact && !$contact['blocked'] && !$contact['pending'];
                }
 
-               if ($owner['hidewall'] && !$is_owner && !$remote_contact) {
-                       throw new HttpException\ForbiddenException($this->t('Access to this item is restricted.'));
+               if ($owner['hidewall'] && !$this->session->isAuthenticated()) {
+                       $this->baseUrl->redirect('profile/' . $owner['nickname'] . '/restricted');
                }
 
                $this->session->set('photo_return', $this->args->getCommand());
@@ -174,13 +174,11 @@ class Photos extends \Friendica\Module\BaseProfile
                        ]);
                }
 
-               $this->page['aside'] .= Widget\VCard::getHTML($owner);
-
                if (!empty($photo_albums_widget)) {
                        $this->page['aside'] .= $photo_albums_widget;
                }
 
-               $o = self::getTabsHTML($this->app, 'photos', $is_owner, $owner['nickname'], Profile::getByUID($owner['uid'])['hide-friends'] ?? false);
+               $o = self::getTabsHTML('photos', $is_owner, $owner['nickname'], Profile::getByUID($owner['uid'])['hide-friends'] ?? false);
 
                $tpl = Renderer::getMarkupTemplate('photos_recent.tpl');
                $o .= Renderer::replaceMacros($tpl, [