diff options
Diffstat (limited to 'mod/acl.php')
-rw-r--r-- | mod/acl.php | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/mod/acl.php b/mod/acl.php index aaf056b60..146cb74c8 100644 --- a/mod/acl.php +++ b/mod/acl.php @@ -2,6 +2,7 @@ /* ACL selector json backend */ require_once("include/acl_selectors.php"); +require_once("include/group.php"); function acl_init(&$a){ @@ -47,31 +48,29 @@ function acl_init(&$a){ $contacts = array(); if ($type=='' || $type=='g'){ - - $r = q("SELECT `groups`.`id`, `groups`.`hash`, `groups`.`name`, - %s as uids + + $r = q("SELECT `groups`.`id`, `groups`.`hash`, `groups`.`name` FROM `groups`,`group_member` WHERE `groups`.`deleted` = 0 AND `groups`.`uid` = %d - AND `group_member`.`gid`=`groups`.`id` - $sql_extra + AND `group_member`.`gid`=`groups`.`id` + $sql_extra GROUP BY `groups`.`id` ORDER BY `groups`.`name` LIMIT %d OFFSET %d", - db_concat('group_member.xchan', ','), intval(local_channel()), intval($count), intval($start) ); foreach($r as $g){ -// logger('acl: group: ' . $g['name'] . ' members: ' . $g['uids']); +// logger('acl: group: ' . $g['name'] . ' members: ' . group_get_members_xchan($g['id'])); $groups[] = array( "type" => "g", "photo" => "images/twopeople.png", "name" => $g['name'], "id" => $g['id'], "xid" => $g['hash'], - "uids" => explode(",",$g['uids']), + "uids" => group_get_members_xchan($g['id']), "link" => '' ); } @@ -94,7 +93,7 @@ function acl_init(&$a){ $r = q("SELECT abook_id as id, xchan_hash as hash, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick, abook_their_perms, abook_flags, abook_self FROM abook left join xchan on abook_xchan = xchan_hash - WHERE (abook_channel = %d $extra_channels_sql) AND abook_blocked = 0 and abook_pending = 0 and abook_archived = 0 and xchan_deleted = 0 $sql_extra2 order by $order_extra2 xchan_name asc" , + WHERE (abook_channel = %d $extra_channels_sql) AND abook_blocked = 0 and abook_pending = 0 and xchan_deleted = 0 $sql_extra2 order by $order_extra2 xchan_name asc" , intval(local_channel()) ); @@ -118,7 +117,7 @@ function acl_init(&$a){ $r2 = q("SELECT abook_id as id, xchan_hash as hash, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick, abook_their_perms, abook_flags, abook_self FROM abook left join xchan on abook_xchan = xchan_hash - WHERE abook_channel IN ($extra_channels_sql) $known_hashes_sql AND abook_blocked = 0 and abook_pending = 0 and abook_archived = 0 and abook_hidden = 0 and xchan_deleted = 0 $sql_extra2 order by $order_extra2 xchan_name asc"); + WHERE abook_channel IN ($extra_channels_sql) $known_hashes_sql AND abook_blocked = 0 and abook_pending = 0 and abook_hidden = 0 and xchan_deleted = 0 $sql_extra2 order by $order_extra2 xchan_name asc"); if($r2) $r = array_merge($r,$r2); |