summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap
diff options
context:
space:
mode:
authorFrédéric Fortier <frederic.fortier@oronospolytechnique.com>2015-08-04 11:19:57 -0400
committerFrédéric Fortier <frederic.fortier@oronospolytechnique.com>2015-08-04 11:19:57 -0400
commite0469d001384eb9c4125ca16d9babdf673be57ee (patch)
tree373fe5446294979d5cd660187296ee3f31865a83 /apps/user_ldap
parent7604bcb3cb07389d76e1f4e8b2023003845efbdd (diff)
downloadnextcloud-server-e0469d001384eb9c4125ca16d9babdf673be57ee.tar.gz
nextcloud-server-e0469d001384eb9c4125ca16d9babdf673be57ee.zip
Take review comments into consideration for pr #18042 / issue #17759
Diffstat (limited to 'apps/user_ldap')
-rw-r--r--apps/user_ldap/group_ldap.php29
1 files changed, 13 insertions, 16 deletions
diff --git a/apps/user_ldap/group_ldap.php b/apps/user_ldap/group_ldap.php
index 44b0ceac7eb..a592913c8f5 100644
--- a/apps/user_ldap/group_ldap.php
+++ b/apps/user_ldap/group_ldap.php
@@ -182,8 +182,8 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface {
}
/**
- * @param string $dnGroup
- * @param array &$seen
+ * @param string $DN
+ * @param array|null &$seen
* @return array
*/
private function _getGroupDNsFromMemberOf($DN, &$seen = null) {
@@ -196,22 +196,19 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface {
}
$seen[$DN] = 1;
$groups = $this->access->readAttribute($DN, 'memberOf');
- if (is_array($groups)) {
- $groups = $this->access->groupsMatchFilter($groups);
- $allGroups = $groups;
- foreach ($groups as $group) {
- $nestedGroups = $this->access->connection->ldapNestedGroups;
- if (!empty($nestedGroups)) {
- $subGroups = $this->_getGroupDNsFromMemberOf($group, $seen);
- if ($subGroups) {
- $allGroups = array_merge($allGroups, $subGroups);
- }
- }
- }
- return $allGroups;
- } else {
+ if (!is_array($groups)) {
return array();
}
+ $groups = $this->access->groupsMatchFilter($groups);
+ $allGroups = $groups;
+ foreach ($groups as $group) {
+ $nestedGroups = $this->access->connection->ldapNestedGroups;
+ if (!empty($nestedGroups)) {
+ $subGroups = $this->_getGroupDNsFromMemberOf($group, $seen);
+ $allGroups = array_merge($allGroups, $subGroups);
+ }
+ }
+ return $allGroups;
}
/**