From ea6f5d429da097278bf65587b28e382b5e3e87be Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Wed, 7 Aug 2013 22:04:05 +0100 Subject: Unbork webpage permissions - missed this because most of my channel_ids are 1. --- mod/editwebpage.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'mod/editwebpage.php') diff --git a/mod/editwebpage.php b/mod/editwebpage.php index c7323a7f7..46c6b8817 100644 --- a/mod/editwebpage.php +++ b/mod/editwebpage.php @@ -9,11 +9,17 @@ function editwebpage_content(&$a) { $which = argv(1); // $a->get_channel() and stuff don't work here, so we've got to find the owner for ourselves. - $owner = q("select channel_id from channel where channel_address = '%s'", + $r = q("select channel_id from channel where channel_address = '%s'", dbesc($which) ); + if($r) { + $owner = intval($r[0]['channel_id']); + //logger('owner: ' . print_r($owner,true)); + } + + if((local_user()) && (argc() > 2) && (argv(2) === 'view')) { $which = $channel['channel_address']; } -- cgit v1.2.3