Skip to content

Commit 57bfe0d

Browse files
committed
flatten result array as expected by following code
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
1 parent fad8dd3 commit 57bfe0d

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

apps/user_ldap/lib/Group_LDAP.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,14 @@ public function inGroup($uid, $gid) {
170170
if (count($filterParts) > 0) {
171171
$filter = $this->access->combineFilterWithOr($filterParts);
172172
$users = $this->access->fetchListOfUsers($filter, $requestAttributes, count($filterParts));
173-
$dns = array_merge($dns, $users);
173+
$dns = array_reduce($users, function (array $carry, array $record) {
174+
if (!in_array($carry, $record['dn'][0])) {
175+
$carry[$record['dn'][0]] = 1;
176+
}
177+
return $carry;
178+
}, $dns);
174179
}
175-
$members = $dns;
180+
$members = array_keys($dns);
176181
break;
177182
}
178183

0 commit comments

Comments
 (0)