Verified Commit 2446d543 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:ambulance: fix(mixedgroups) Correctly fill memberUid when there are subgroups

issue #6081
Showing with 10 additions and 3 deletions
+10 -3
<?php <?php
/* /*
This code is part of FusionDirectory (http://www.fusiondirectory.org/) This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2015-2016 FusionDirectory
Copyright (C) 2015-2020 FusionDirectory
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -142,9 +143,15 @@ class mixedGroup extends simplePlugin ...@@ -142,9 +143,15 @@ class mixedGroup extends simplePlugin
$members = $this->parent->getBaseObject()->member; $members = $this->parent->getBaseObject()->member;
$memberUid = []; $memberUid = [];
foreach ($members as $dn) { foreach ($members as $dn) {
$ldap->cat($dn, ['uid']); $ldap->cat($dn, ['uid','memberUid']);
$attrs = $ldap->fetch(); $attrs = $ldap->fetch();
$memberUid[] = $attrs['uid'][0]; if (isset($attrs['uid'][0])) {
$memberUid[] = $attrs['uid'][0];
}
if (isset($attrs['memberUid'][0])) {
unset($attrs['memberUid']['count']);
$memberUid = array_merge_unique($memberUid, $attrs['memberUid']);
}
} }
$this->memberUid = $memberUid; $this->memberUid = $memberUid;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment