custom/expert permissions bug

This commit is contained in:
redmatrix 2016-09-06 16:15:45 -07:00
parent 760427fc43
commit 57033bb599

View File

@ -1627,13 +1627,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;
}