aboutsummaryrefslogtreecommitdiffstats
path: root/mod/network.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/network.php')
-rw-r--r--mod/network.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/mod/network.php b/mod/network.php
index ecbeb4085..f71a7569a 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -117,8 +117,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();