LDAP: cache display names immediately on retrieval, saves tens of unecessary queries to LDAP server in the share dialog for example
This commit is contained in:
parent
a4ab29da6e
commit
1c71d5c444
|
@ -434,12 +434,18 @@ class Access extends LDAPUtility {
|
|||
$ocname = $this->dn2ocname($ldapObject['dn'], $nameByLDAP, $isUsers);
|
||||
if($ocname) {
|
||||
$ownCloudNames[] = $ocname;
|
||||
$this->cacheDisplayName($ocname, $nameByLDAP);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
return $ownCloudNames;
|
||||
}
|
||||
|
||||
public function cacheDisplayName($uid, $displayName) {
|
||||
$cacheKeyTrunk = 'getDisplayName';
|
||||
$this->connection->writeToCache($cacheKeyTrunk.$uid,$displayName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief creates a unique name for internal ownCloud use for users. Don't call it directly.
|
||||
* @param $name the display name of the object
|
||||
|
|
Loading…
Reference in New Issue