diff options
author | Mario <mario@mariovavti.com> | 2020-05-04 09:24:22 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2020-05-04 09:24:22 +0000 |
commit | 46242aeaae084191244008529703c964fa5b2d53 (patch) | |
tree | fa38ce637477d09ce33c5ff43037d559c648130b | |
parent | ad040a0b111539d6cdc4922539d550e21500be04 (diff) | |
download | volse-hubzilla-46242aeaae084191244008529703c964fa5b2d53.tar.gz volse-hubzilla-46242aeaae084191244008529703c964fa5b2d53.tar.bz2 volse-hubzilla-46242aeaae084191244008529703c964fa5b2d53.zip |
display complete perminfo only to owner
-rw-r--r-- | Zotlabs/Module/Viewconnections.php | 6 | ||||
-rw-r--r-- | include/text.php | 7 | ||||
-rwxr-xr-x | view/tpl/contact_template.tpl | 2 | ||||
-rw-r--r-- | view/tpl/micropro_card.tpl | 2 | ||||
-rwxr-xr-x | view/tpl/micropro_img.tpl | 2 |
5 files changed, 10 insertions, 9 deletions
diff --git a/Zotlabs/Module/Viewconnections.php b/Zotlabs/Module/Viewconnections.php index 320a331d1..a0c293ddf 100644 --- a/Zotlabs/Module/Viewconnections.php +++ b/Zotlabs/Module/Viewconnections.php @@ -97,7 +97,6 @@ class Viewconnections extends \Zotlabs\Web\Controller { $perminfo['connperms'] .= t('Nothing'); } - $url = chanlink_hash($rr['xchan_hash']); if($url) { $contacts[] = array( @@ -111,13 +110,12 @@ class Viewconnections extends \Zotlabs\Web\Controller { 'sparkle' => '', 'itemurl' => $rr['url'], 'network' => '', - 'perminfo' => $perminfo, + 'perminfo' => (($is_owner) ? $perminfo : (($perminfo['connpermcount'] === 0) ? $perminfo : [])), 'oneway' => $oneway ); } } - - + if($_REQUEST['aj']) { if($contacts) { $o = replace_macros(get_markup_template('viewcontactsajax.tpl'),array( diff --git a/include/text.php b/include/text.php index 6f56a0754..0202061ab 100644 --- a/include/text.php +++ b/include/text.php @@ -1010,7 +1010,7 @@ function contact_block() { if(count($r)) { $contacts = t('Connections'); - $micropro = Array(); + $micropro = []; foreach($r as $rr) { // There is no setting to discover if you are bi-directionally connected @@ -1037,6 +1037,9 @@ function contact_block() { $rr['perminfo']['connperms'] .= t('Nothing'); } + if($is_owner && $rr['perminfo']['connpermcount'] !== 0) + unset($rr['perminfo']); + $micropro[] = micropro($rr,true,'mpfriend'); } } @@ -1047,7 +1050,7 @@ function contact_block() { '$contacts' => $contacts, '$nickname' => App::$profile['channel_address'], '$viewconnections' => (($total > $shown) ? sprintf(t('View all %s connections'),$total) : ''), - '$micropro' => $micropro, + '$micropro' => $micropro )); $arr = ['contacts' => $r, 'output' => $o]; diff --git a/view/tpl/contact_template.tpl b/view/tpl/contact_template.tpl index 40495b789..73fa5adde 100755 --- a/view/tpl/contact_template.tpl +++ b/view/tpl/contact_template.tpl @@ -1,7 +1,7 @@ <div class="contact-entry-wrapper" id="contact-entry-wrapper-{{$contact.id}}" > <div class="contact-entry-photo-wrapper" > <a href="{{$contact.link}}" title="{{$contact.img_hover}}" ><img class="contact-block-img" src="{{$contact.thumb}}" alt="{{$contact.name}}" /></a> - {{include "connstatus.tpl" perminfo=$contact.perminfo}} + {{if $contact.perminfo}}{{include "connstatus.tpl" perminfo=$contact.perminfo}}{{/if}} </div> <div class="contact-entry-photo-end" ></div> <div class="contact-entry-name" id="contact-entry-name-{{$contact.id}}" >{{$contact.name}}</div> diff --git a/view/tpl/micropro_card.tpl b/view/tpl/micropro_card.tpl index 1bdf92da1..058bfc14c 100644 --- a/view/tpl/micropro_card.tpl +++ b/view/tpl/micropro_card.tpl @@ -1,5 +1,5 @@ <a class="list-group-item{{if $class}} {{$class}}{{/if}} fakelink" href="{{if $click}}#{{else}}{{$url}}{{/if}}" {{if $click}}onclick="{{$click}}"{{/if}}> - <img class="menu-img-3" src="{{$photo}}" title="{{$title}}" alt="" />{{include "connstatus.tpl"}} + <img class="menu-img-3" src="{{$photo}}" title="{{$title}}" alt="" />{{if $perminfo}}{{include "connstatus.tpl"}}{{/if}} <span class="contactname">{{$name}}</span> <span class="dropdown-sub-text">{{$addr}}<br>{{$network}}</span> </a> diff --git a/view/tpl/micropro_img.tpl b/view/tpl/micropro_img.tpl index f023a2d00..98f33d119 100755 --- a/view/tpl/micropro_img.tpl +++ b/view/tpl/micropro_img.tpl @@ -1 +1 @@ -<div class="contact-block-div{{if $class}} {{$class}}{{/if}}"><a class="contact-block-link{{if $class}} {{$class}}{{/if}}{{if $click}} fakelink{{/if}}" href="{{if $click}}#{{else}}{{$url}}{{/if}}" {{if $click}}onclick="{{$click}}"{{/if}}><img class="contact-block-img{{if $class}} {{$class}}{{/if}}" src="{{$photo}}" title="{{$title}}" alt="" />{{include "connstatus.tpl"}}</a></div> +<div class="contact-block-div{{if $class}} {{$class}}{{/if}}"><a class="contact-block-link{{if $class}} {{$class}}{{/if}}{{if $click}} fakelink{{/if}}" href="{{if $click}}#{{else}}{{$url}}{{/if}}" {{if $click}}onclick="{{$click}}"{{/if}}><img class="contact-block-img{{if $class}} {{$class}}{{/if}}" src="{{$photo}}" title="{{$title}}" alt="" />{{if $perminfo}}{{include "connstatus.tpl"}}{{/if}}</a></div> |