mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
Merge pull request #51111 from nextcloud/backport/47513/stable31
This commit is contained in:
commit
b46f010c1e
3 changed files with 2 additions and 18 deletions
|
|
@ -956,22 +956,6 @@ class Access extends LDAPUtility {
|
|||
}
|
||||
$groupRecords = $this->searchGroups($filter, $attr, $limit, $offset);
|
||||
|
||||
$listOfDNs = array_reduce($groupRecords, function ($listOfDNs, $entry) {
|
||||
$listOfDNs[] = $entry['dn'][0];
|
||||
return $listOfDNs;
|
||||
}, []);
|
||||
$idsByDn = $this->getGroupMapper()->getListOfIdsByDn($listOfDNs);
|
||||
|
||||
array_walk($groupRecords, function (array $record) use ($idsByDn): void {
|
||||
$newlyMapped = false;
|
||||
$gid = $idsByDn[$record['dn'][0]] ?? null;
|
||||
if ($gid === null) {
|
||||
$gid = $this->dn2ocname($record['dn'][0], null, false, $newlyMapped, $record);
|
||||
}
|
||||
if (!$newlyMapped && is_string($gid)) {
|
||||
$this->cacheGroupExists($gid);
|
||||
}
|
||||
});
|
||||
$listOfGroups = $this->fetchList($groupRecords, $this->manyAttributes($attr));
|
||||
$this->connection->writeToCache($cacheKey, $listOfGroups);
|
||||
return $listOfGroups;
|
||||
|
|
|
|||
|
|
@ -665,7 +665,7 @@ class AccessTest extends TestCase {
|
|||
$this->groupMapper->expects($this->never())
|
||||
->method('getNameByDN');
|
||||
|
||||
$this->connection->expects($this->exactly(3))
|
||||
$this->connection->expects($this->exactly(1))
|
||||
->method('writeToCache');
|
||||
|
||||
$groups = $this->access->fetchListOfGroups($filter, $attributes);
|
||||
|
|
|
|||
|
|
@ -151,6 +151,7 @@ Feature: LDAP
|
|||
| ldapAttributesForUserSearch | employeeNumber |
|
||||
| useMemberOfToDetectMembership | 1 |
|
||||
And parameter "shareapi_only_share_with_group_members" of app "core" is set to "yes"
|
||||
And invoking occ with "ldap:check-group cn=Orcharding,ou=OtherGroups,dc=nextcloud,dc=ci --update"
|
||||
And As an "alice"
|
||||
When getting sharees for
|
||||
# "5" is part of the employee number of some LDAP records
|
||||
|
|
@ -162,4 +163,3 @@ Feature: LDAP
|
|||
And "users" sharees returned are
|
||||
| Elisa | 0 | elisa |
|
||||
And "exact groups" sharees returned is empty
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue