From 3cb179aff19d803b91261e410c50b36e4bae1246 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 13 Mar 2014 17:13:36 -0700 Subject: contact_block() not being shown to unauthenticated visitors - even if perms allow. Also separate the permissions logic for this function so that we can have a mini-profile widget and a separate contact_block widget instead of always lumping them together. We probably also should move contact_block() outside of include/text.php as it doesn't really belong there. Just not sure where it belongs - perhaps contact_widgets wouold be a good place. --- include/identity.php | 5 +---- include/text.php | 6 ++++++ 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/identity.php b/include/identity.php index ed6920e67..efc0d7d87 100644 --- a/include/identity.php +++ b/include/identity.php @@ -711,10 +711,7 @@ logger('online: ' . $profile['online']); ? trim(substr($profile['name'],0,strpos($profile['name'],' '))) : $profile['name']); $lastname = (($firstname === $profile['name']) ? '' : trim(substr($profile['name'],strlen($firstname)))); - if(is_array($observer) - && perm_is_allowed($profile['uid'],$observer['xchan_hash'],'view_contacts')) { - $contact_block = contact_block(); - } + $contact_block = contact_block(); $channel_menu = false; $menu = get_pconfig($profile['uid'],'system','channel_menu'); diff --git a/include/text.php b/include/text.php index 839e63f5e..53b92c05f 100755 --- a/include/text.php +++ b/include/text.php @@ -656,6 +656,12 @@ function contact_block() { $o = ''; $a = get_app(); + if(! $a->profile['uid']) + return; + + if(! perm_is_allowed($a->profile['uid'],get_observer_hash(),'view_contacts')) + return; + $shown = get_pconfig($a->profile['uid'],'system','display_friend_count'); if($shown === false) -- cgit v1.2.3