Bugfix: The ACL lookup had its problems after the last changes

This commit is contained in:
Michael 2017-07-27 14:02:25 +00:00
parent 83425a784b
commit 57b4ea4759

View file

@ -546,7 +546,7 @@ function acl_lookup(App $a, $out_type = 'json') {
"forum" => '0' "forum" => '0'
); );
} }
if (count($groups) > 0) { if ((count($groups) > 0) && ($search == "")) {
$groups[] = array("separator" => true); $groups[] = array("separator" => true);
} }
} }
@ -557,7 +557,7 @@ function acl_lookup(App $a, $out_type = 'json') {
WHERE `uid` = %d AND NOT `self` AND NOT `blocked` AND NOT `pending` AND NOT `archive` AND `notify` != '' WHERE `uid` = %d AND NOT `self` AND NOT `blocked` AND NOT `pending` AND NOT `archive` AND `notify` != ''
AND `success_update` >= `failure_update` AND NOT (`network` IN ('%s', '%s')) AND `success_update` >= `failure_update` AND NOT (`network` IN ('%s', '%s'))
$sql_extra2 $sql_extra2
ORDER BY `frm` DESC, `name` ASC ", ORDER BY `name` ASC ",
intval(local_user()), intval(local_user()),
dbesc(NETWORK_OSTATUS), dbesc(NETWORK_STATUSNET) dbesc(NETWORK_OSTATUS), dbesc(NETWORK_STATUSNET)
); );
@ -638,7 +638,9 @@ function acl_lookup(App $a, $out_type = 'json') {
} }
} }
if (count($forums) > 0) { if (count($forums) > 0) {
if ($search == "") {
$forums[] = array("separator" => true); $forums[] = array("separator" => true);
}
$contacts = array_merge($forums, $contacts); $contacts = array_merge($forums, $contacts);
} }
} }