Skip to content

Commit

Permalink
flatten result array as expected by following code
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
  • Loading branch information
blizzz committed Nov 26, 2020
1 parent fad8dd3 commit 57bfe0d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions apps/user_ldap/lib/Group_LDAP.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,14 @@ public function inGroup($uid, $gid) {
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;
}

Expand Down

0 comments on commit 57bfe0d

Please sign in to comment.