[Pkg-owncloud-commits] [owncloud] 01/32: LDAP: cache display names immediately on retrieval, saves tens of unecessary queries to LDAP server in the share dialog for example

David Prévot taffit at moszumanska.debian.org
Wed Apr 23 18:58:59 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 97d6db966c771963c78efce7f8e64fd31c57aa9e
Author: Arthur Schiwon <blizzz at owncloud.com>
Date:   Wed Apr 16 12:56:08 2014 +0200

    LDAP: cache display names immediately on retrieval, saves tens of unecessary queries to LDAP server in the share dialog for example
---
 apps/user_ldap/lib/access.php | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php
index ae25918..5b5515f 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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list