]> source.dussan.org Git - nextcloud-server.git/commitdiff
flatten result array as expected by following code
authorArthur Schiwon <blizzz@arthur-schiwon.de>
Thu, 26 Nov 2020 22:36:04 +0000 (23:36 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Tue, 15 Dec 2020 21:37:47 +0000 (21:37 +0000)
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
apps/user_ldap/lib/Group_LDAP.php

index 5444f0815e3230cb663019e1c2ba855dda0eb51e..e396999f8692da116dfa5a5a8d4aae7dd6616cac 100644 (file)
@@ -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;
                }