From d818975d84ed4b0876656326f8d50b8a57ea4ff6 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Thu, 26 Nov 2020 23:36:04 +0100 Subject: [PATCH] flatten result array as expected by following code Signed-off-by: Arthur Schiwon --- apps/user_ldap/lib/Group_LDAP.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/user_ldap/lib/Group_LDAP.php b/apps/user_ldap/lib/Group_LDAP.php index 5444f0815e..e396999f86 100644 --- a/apps/user_ldap/lib/Group_LDAP.php +++ b/apps/user_ldap/lib/Group_LDAP.php @@ -170,9 +170,14 @@ class Group_LDAP extends BackendUtility implements GroupInterface, IGroupLDAP, I if (count($filterParts) > 0) { $filter = $this->access->combineFilterWithOr($filterParts); $users = $this->access->fetchListOfUsers($filter, $requestAttributes, count($filterParts)); - $dns = array_merge($dns, $users); + $dns = array_reduce($users, function (array $carry, array $record) { + if (!in_array($carry, $record['dn'][0])) { + $carry[$record['dn'][0]] = 1; + } + return $carry; + }, $dns); } - $members = $dns; + $members = array_keys($dns); break; }