Enable profile contacts page for profile owner

This commit is contained in:
Hypolite Petovan 2020-08-09 09:09:38 -04:00
parent b219677de5
commit 3d3ad07385

View File

@ -51,14 +51,14 @@ class Contacts extends Module\BaseProfile
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.')); throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
} }
if (!empty($a->profile['hide-friends'])) { $is_owner = $a->profile['uid'] == local_user();
if (!empty($a->profile['hide-friends']) && !$is_owner) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.')); throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
} }
Nav::setSelected('home'); Nav::setSelected('home');
$is_owner = $a->profile['uid'] == local_user();
$o = self::getTabsHTML($a, 'contacts', $is_owner, $nickname); $o = self::getTabsHTML($a, 'contacts', $is_owner, $nickname);
$tabs = self::getContactFilterTabs('profile/' . $nickname, $type, Session::isAuthenticated() && $a->profile['uid'] != local_user()); $tabs = self::getContactFilterTabs('profile/' . $nickname, $type, Session::isAuthenticated() && $a->profile['uid'] != local_user());