mirror of
https://github.com/nextcloud/server.git
synced 2026-04-22 23:03:00 -04:00
Merge pull request #19821 from owncloud/GreenArchon-fix-memberof-regression
Revert "adjust to nested group fix
This commit is contained in:
commit
9e6a4dce43
2 changed files with 5 additions and 15 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Reference in a new issue