From 9980645ab8bf061decc36837ceea1dc5ead9f824 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 21 Mar 2015 13:37:55 +0100 Subject: fix acl for if we have an cid in /network and make $bang better visible --- mod/network.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 7f8d39044..a145aca36 100644 --- a/mod/network.php +++ b/mod/network.php @@ -116,8 +116,21 @@ function network_content(&$a, $update = 0, $load = false) { if(x($_GET,'search') || x($_GET,'file')) $nouveau = true; - if($cid) - $def_acl = array('allow_cid' => '<' . intval($cid) . '>'); + if($cid) { + $r = q("SELECT abook_xchan FROM abook WHERE abook_id = %d AND abook_channel = %d LIMIT 1", + intval($cid), + intval(local_channel()) + ); + if(! $r) { + if($update) { + killme(); + } + notice( t('No such channel') . EOL ); + goaway($a->get_baseurl(true) . '/network'); + // NOTREACHED + } + $def_acl = array('allow_cid' => '<' . $r[0]['abook_xchan'] . '>'); + } if(! $update) { $tabs = network_tabs(); -- cgit v1.2.3