summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2014-04-16 12:56:08 +0200
committerArthur Schiwon <blizzz@owncloud.com>2014-04-16 12:56:08 +0200
commit97d6db966c771963c78efce7f8e64fd31c57aa9e (patch)
tree329fc1a7ce735017a2583ead05095315616f841b
parentcf2fc58c65342295b4686f2aae2c3be351388f47 (diff)
downloadnextcloud-server-97d6db966c771963c78efce7f8e64fd31c57aa9e.tar.gz
nextcloud-server-97d6db966c771963c78efce7f8e64fd31c57aa9e.zip
LDAP: cache display names immediately on retrieval, saves tens of unecessary queries to LDAP server in the share dialog for example
-rw-r--r--apps/user_ldap/lib/access.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php
index ae25918af89..5b5515f5651 100644
--- a/apps/user_ldap/lib/access.php
+++ b/apps/user_ldap/lib/access.php
@@ -483,12 +483,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