diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2014-04-16 12:56:08 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2014-04-22 18:36:37 +0200 |
commit | 1c71d5c444a0f4b2263ffb1d2a40969880151015 (patch) | |
tree | 0d3a2249e6897f6d2d1ccd32f71a86ccd5e80356 | |
parent | a4ab29da6e48387d82581064b6ab1695465b9da7 (diff) | |
download | nextcloud-server-1c71d5c444a0f4b2263ffb1d2a40969880151015.tar.gz nextcloud-server-1c71d5c444a0f4b2263ffb1d2a40969880151015.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.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php index 8d622dcb794..d047149fc73 100644 --- a/apps/user_ldap/lib/access.php +++ b/apps/user_ldap/lib/access.php @@ -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 |