Skip to content

Commit ab9f13a

Browse files
committed
fixup! read records from DB for lists at once, not one by one.
1 parent acd0a83 commit ab9f13a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

apps/user_ldap/lib/Access.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -882,10 +882,10 @@ public function fetchListOfUsers($filter, $attr, $limit = null, $offset = null,
882882
$listOfDNs[] = $entry['dn'][0];
883883
return $listOfDNs;
884884
}, []);
885-
$uidsByDn = $this->userMapper->getListOfIdsByDn($listOfDNs);
886-
$recordsToUpdate = array_filter($ldapRecords, function($record) use ($isBackgroundJobModeAjax, $uidsByDn) {
885+
$idsByDn = $this->userMapper->getListOfIdsByDn($listOfDNs);
886+
$recordsToUpdate = array_filter($ldapRecords, function($record) use ($isBackgroundJobModeAjax, $idsByDn) {
887887
$newlyMapped = false;
888-
$uid = $uidsByDn[$record['dn'][0]] ?? null;
888+
$uid = $idsByDn[$record['dn'][0]] ?? null;
889889
if($uid === null) {
890890
$uid = $this->dn2ocname($record['dn'][0], null, true, $newlyMapped, $record);
891891
}

apps/user_ldap/lib/Mapping/AbstractMapping.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ protected function modify($query, $parameters) {
117117
*/
118118
public function getDNByName($name) {
119119
$dn = array_search($name, $this->cache);
120-
if($dn === null) {
120+
if($dn === false) {
121121
$dn = $this->getXbyY('ldap_dn', 'owncloud_name', $name);
122122
$this->cache[$dn] = $name;
123123
}

0 commit comments

Comments
 (0)