custom/expert permissions bug

This commit is contained in:
redmatrix 2016-09-06 16:15:45 -07:00
parent 95d24f1d30
commit 005186bf4a

View File

@ -1637,13 +1637,24 @@ function notifications_on($channel_id,$value) {
function get_channel_default_perms($uid) { function get_channel_default_perms($uid) {
$ret = [];
$r = q("select abook_xchan from abook where abook_channel = %d and abook_self = 1 limit 1", $r = q("select abook_xchan from abook where abook_channel = %d and abook_self = 1 limit 1",
intval($uid) intval($uid)
); );
if($r) if($r) {
return load_abconfig($uid,$r[0]['abook_xchan'],'my_perms'); $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;
} }