[Pkg-owncloud-commits] [owncloud] 02/32: add additional comments, PHPdoc and check whether it's really applicable

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 02de48e1baa58b37d0bc58963312cd75e7925337
Author: Arthur Schiwon <blizzz at owncloud.com>
Date:   Wed Apr 16 17:16:51 2014 +0200

    add additional comments, PHPdoc and check whether it's really applicable
---
 apps/user_ldap/lib/access.php | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php
index 5b5515f..0fd1063 100644
--- a/apps/user_ldap/lib/access.php
+++ b/apps/user_ldap/lib/access.php
@@ -483,16 +483,25 @@ class Access extends LDAPUtility {
 			$ocname = $this->dn2ocname($ldapObject['dn'], $nameByLDAP, $isUsers);
 			if($ocname) {
 				$ownCloudNames[] = $ocname;
-				$this->cacheDisplayName($ocname, $nameByLDAP);
+				if($isUsers) {
+					//cache the user names so it does not need to be retrieved
+					//again later (e.g. sharing dialogue).
+					$this->cacheUserDisplayName($ocname, $nameByLDAP);
+				}
 			}
 			continue;
 		}
 		return $ownCloudNames;
 	}
 
-	public function cacheDisplayName($uid, $displayName) {
+	/**
+	 * @brief caches the user display name
+	 * @param string the internal owncloud username
+	 * @param string the display name
+	 */
+	public function cacheUserDisplayName($ocname, $displayName) {
 		$cacheKeyTrunk = 'getDisplayName';
-		$this->connection->writeToCache($cacheKeyTrunk.$uid,$displayName);
+		$this->connection->writeToCache($cacheKeyTrunk.$ocname, $displayName);
 	}
 
 	/**

-- 
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