From f178f612d8d0305fae304dafd2ba1d5708ef9c79 Mon Sep 17 00:00:00 2001 From: Frédéric Fortier Date: Thu, 15 Oct 2015 20:30:27 -0400 Subject: Revert "adjust to nested group fix This reverts commit 845485cfe, which fixes #19816 regression. --- apps/user_ldap/group_ldap.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/apps/user_ldap/group_ldap.php b/apps/user_ldap/group_ldap.php index cf58e5b902d..2e36a337b04 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(); } -- cgit v1.2.3 From 733542a26420fb3b1277a23947bc895c595d1a07 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Fri, 16 Oct 2015 10:35:40 +0200 Subject: Fix style --- apps/user_ldap/group_ldap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/user_ldap/group_ldap.php b/apps/user_ldap/group_ldap.php index 2e36a337b04..4fd029c74da 100644 --- a/apps/user_ldap/group_ldap.php +++ b/apps/user_ldap/group_ldap.php @@ -209,7 +209,7 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface { $subGroups = $this->_getGroupDNsFromMemberOf($group, $seen); $allGroups = array_merge($allGroups, $subGroups); } - } + } return $allGroups; } -- cgit v1.2.3 From d486949705f52481f4155804ba21fe7d68834395 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Fri, 16 Oct 2015 10:35:47 +0200 Subject: Adjust unit tests --- apps/user_ldap/tests/group_ldap.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) 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)); -- cgit v1.2.3