From 005186bf4a461578d068aaab6164c84dd7ea9409 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 6 Sep 2016 16:15:45 -0700 Subject: custom/expert permissions bug --- include/channel.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'include/channel.php') diff --git a/include/channel.php b/include/channel.php index 2c892dbb9..7bfa2b6a2 100644 --- a/include/channel.php +++ b/include/channel.php @@ -1637,13 +1637,24 @@ function notifications_on($channel_id,$value) { function get_channel_default_perms($uid) { + + $ret = []; + $r = q("select abook_xchan from abook where abook_channel = %d and abook_self = 1 limit 1", intval($uid) ); - if($r) - return load_abconfig($uid,$r[0]['abook_xchan'],'my_perms'); + if($r) { + $x = load_abconfig($uid,$r[0]['abook_xchan'],'my_perms'); + if($x) { + foreach($x as $xv) { + if(intval($xv['v'])) { + $ret[] = $xv['k']; + } + } + } + } - return array(); + return $ret; } -- cgit v1.2.3