aboutsummaryrefslogtreecommitdiffstats
path: root/mod/viewconnections.php
diff options
context:
space:
mode:
authormarijus <mario@mariovavti.com>2014-05-09 07:39:27 +0200
committermarijus <mario@mariovavti.com>2014-05-09 07:39:27 +0200
commit56eb9e75ccad49c8fcbd569b097c2ea85e7d258f (patch)
tree87411ce648195b34f0a02ed49d60b007a6a8470d /mod/viewconnections.php
parent6e397240a3f1a1bb52ef5d9bd3929a6770ac8222 (diff)
parent831b18cf283cd52fd1b01d6c6c4648b8351985a7 (diff)
downloadvolse-hubzilla-56eb9e75ccad49c8fcbd569b097c2ea85e7d258f.tar.gz
volse-hubzilla-56eb9e75ccad49c8fcbd569b097c2ea85e7d258f.tar.bz2
volse-hubzilla-56eb9e75ccad49c8fcbd569b097c2ea85e7d258f.zip
Merge branch 'master' of https://github.com/friendica/red
Diffstat (limited to 'mod/viewconnections.php')
-rw-r--r--mod/viewconnections.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/mod/viewconnections.php b/mod/viewconnections.php
index f5e7ab213..b6a6b483c 100644
--- a/mod/viewconnections.php
+++ b/mod/viewconnections.php
@@ -28,11 +28,19 @@ function viewconnections_content(&$a) {
return;
}
+ $is_owner = ((local_user() && local_user() == $a->profile['uid']) ? true : false);
+
+ $abook_flags = ABOOK_FLAG_PENDING|ABOOK_FLAG_SELF;
+ $xchan_flags = XCHAN_FLAGS_ORPHAN|XCHAN_FLAGS_DELETED;
+ if(! $is_owner) {
+ $abook_flags = $abook_flags | ABOOK_FLAGS_HIDDEN;
+ $xchan_flags = $xchan_flags | XCHAN_FLAGS_HIDDEN;
+ }
$r = q("SELECT count(*) as total FROM abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and not (abook_flags & %d ) and not ( xchan_flags & %d ) ",
intval($a->profile['uid']),
- intval(ABOOK_FLAG_HIDDEN|ABOOK_FLAG_PENDING|ABOOK_FLAG_SELF),
- intval(XCHAN_FLAGS_HIDDEN|XCHAN_FLAGS_ORPHAN|XCHAN_FLAGS_DELETED)
+ intval($abook_flags),
+ intval($xchan_flags)
);
if($r) {
$a->set_pager_total($r[0]['total']);
@@ -40,8 +48,8 @@ function viewconnections_content(&$a) {
$r = q("SELECT * FROM abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and not ( abook_flags & %d ) and not ( xchan_flags & %d ) order by xchan_name LIMIT %d , %d ",
intval($a->profile['uid']),
- intval(ABOOK_FLAG_HIDDEN|ABOOK_FLAG_PENDING|ABOOK_FLAG_SELF),
- intval(XCHAN_FLAGS_HIDDEN|XCHAN_FLAGS_ORPHAN|XCHAN_FLAGS_DELETED),
+ intval($abook_flags),
+ intval($xchan_flags),
intval($a->pager['start']),
intval($a->pager['itemspage'])
);