connection->setConfiguration(['ldapGroupFilter' => 'objectClass=groupOfNames']); $this->connection->setConfiguration(['ldapGroupMemberAssocAttr' => 'member']); $userMapper = new UserMapping(\OC::$server->getDatabaseConnection()); $userMapper->clear(); $this->access->setUserMapper($userMapper); $groupMapper = new GroupMapping(\OC::$server->getDatabaseConnection()); $groupMapper->clear(); $this->access->setGroupMapper($groupMapper); $userBackend = new User_LDAP($this->access, \OC::$server->getNotificationManager(), \OC::$server->get(UserPluginManager::class), \OC::$server->get(LoggerInterface::class), \OC::$server->get(DeletedUsersIndex::class)); $userManager = \OC::$server->getUserManager(); $userManager->clearBackends(); $userManager->registerBackend($userBackend); $groupBackend = new Group_LDAP($this->access, \OC::$server->query(GroupPluginManager::class), \OC::$server->get(IConfig::class)); $groupManger = \OC::$server->getGroupManager(); $groupManger->clearBackends(); $groupManger->addBackend($groupBackend); } protected function caseNativeUUIDAttributeUsers() { // trigger importing of users which also triggers UUID attribute detection \OC::$server->getUserManager()->search('', 5, 0); return $this->connection->ldapUuidUserAttribute === 'entryuuid'; } protected function caseNativeUUIDAttributeGroups() { // essentially the same as 'caseNativeUUIDAttributeUsers', code paths // are similar, but we take no chances. // trigger importing of users which also triggers UUID attribute detection \OC::$server->getGroupManager()->search('', 5, 0); return $this->connection->ldapUuidGroupAttribute === 'entryuuid'; } } /** @var string $host */ /** @var int $port */ /** @var string $adn */ /** @var string $apwd */ /** @var string $bdn */ $test = new IntegrationTestAttributeDetection($host, $port, $adn, $apwd, $bdn); $test->init(); $test->run();