diff options
author | C. Montero Luque <cmonteroluque@users.noreply.github.com> | 2015-10-16 13:39:57 -0400 |
---|---|---|
committer | C. Montero Luque <cmonteroluque@users.noreply.github.com> | 2015-10-16 13:39:57 -0400 |
commit | 9e6a4dce43e298cbbfde963242d4f6780784a2ae (patch) | |
tree | 9b3b73857f6f6dd3a7e31950f85759d0a7696560 | |
parent | 9d910deef01657bfcc6bcdf61ef72c12961fc52a (diff) | |
parent | d486949705f52481f4155804ba21fe7d68834395 (diff) | |
download | nextcloud-server-9e6a4dce43e298cbbfde963242d4f6780784a2ae.tar.gz nextcloud-server-9e6a4dce43e298cbbfde963242d4f6780784a2ae.zip |
Merge pull request #19821 from owncloud/GreenArchon-fix-memberof-regression
Revert "adjust to nested group fix
-rw-r--r-- | apps/user_ldap/group_ldap.php | 9 | ||||
-rw-r--r-- | apps/user_ldap/tests/group_ldap.php | 11 |
2 files changed, 5 insertions, 15 deletions
diff --git a/apps/user_ldap/group_ldap.php b/apps/user_ldap/group_ldap.php index cf58e5b902d..4fd029c74da 100644 --- a/apps/user_ldap/group_ldap.php +++ b/apps/user_ldap/group_ldap.php @@ -33,7 +33,6 @@ namespace OCA\user_ldap; use OCA\user_ldap\lib\Access; use OCA\user_ldap\lib\BackendUtility; -use OCA\user_ldap\lib\user\User; class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface { protected $enabled = false; @@ -198,11 +197,7 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface { return array(); } $seen[$DN] = 1; - $user = $this->access->userManager->get($DN); - if(!$user instanceof User) { - return array(); - } - $groups = $user->getMemberOfGroups(); + $groups = $this->access->readAttribute($DN, 'memberOf'); if (!is_array($groups)) { return array(); } @@ -214,7 +209,7 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface { $subGroups = $this->_getGroupDNsFromMemberOf($group, $seen); $allGroups = array_merge($allGroups, $subGroups); } - } + } return $allGroups; } diff --git a/apps/user_ldap/tests/group_ldap.php b/apps/user_ldap/tests/group_ldap.php index 8ed2bc5c677..49af5e3fe34 100644 --- a/apps/user_ldap/tests/group_ldap.php +++ b/apps/user_ldap/tests/group_ldap.php @@ -42,14 +42,9 @@ class Test_Group_Ldap extends \Test\TestCase { $connector = $this->getMock('\OCA\user_ldap\lib\Connection', $conMethods, array($lw, null, null)); - $um = new \OCA\user_ldap\lib\user\Manager( - $this->getMock('\OCP\IConfig'), - $this->getMock('\OCA\user_ldap\lib\FilesystemHelper'), - $this->getMock('\OCA\user_ldap\lib\LogWrapper'), - $this->getMock('\OCP\IAvatarManager'), - $this->getMock('\OCP\Image'), - $this->getMock('\OCP\IDBConnection') - ); + $um = $this->getMockBuilder('\OCA\user_ldap\lib\user\Manager') + ->disableOriginalConstructor() + ->getMock(); $access = $this->getMock('\OCA\user_ldap\lib\Access', $accMethods, array($connector, $lw, $um)); |