diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2012-10-22 22:46:28 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2012-10-22 23:50:25 +0200 |
commit | 0c57d94467db7e4bace3c72773bbdda7600ac8f3 (patch) | |
tree | 92e443b7a13fc1c8bb0c783c89e4c6893454b95f /apps | |
parent | 366aeb72287a0884258d50db4dd885291aaae0fa (diff) | |
download | nextcloud-server-0c57d94467db7e4bace3c72773bbdda7600ac8f3.tar.gz nextcloud-server-0c57d94467db7e4bace3c72773bbdda7600ac8f3.zip |
LDAP: fix cache save and check, fixes oc-2118
Diffstat (limited to 'apps')
-rw-r--r-- | apps/user_ldap/group_ldap.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/user_ldap/group_ldap.php b/apps/user_ldap/group_ldap.php index bd9f7e0c552..9780fc75f9e 100644 --- a/apps/user_ldap/group_ldap.php +++ b/apps/user_ldap/group_ldap.php @@ -96,12 +96,13 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface { if(!$this->enabled) { return array(); } - if($this->connection->isCached('getUserGroups'.$uid)) { - return $this->connection->getFromCache('getUserGroups'.$uid); + $cacheKey = 'getUserGroups'.$uid; + if($this->connection->isCached($cacheKey)) { + return $this->connection->getFromCache($cacheKey); } $userDN = $this->username2dn($uid); if(!$userDN) { - $this->connection->writeToCache('getUserGroups'.$uid, array()); + $this->connection->writeToCache($cacheKey, array()); return array(); } @@ -124,7 +125,7 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface { )); $groups = $this->fetchListOfGroups($filter, array($this->connection->ldapGroupDisplayName,'dn')); $groups = array_unique($this->ownCloudGroupNames($groups), SORT_LOCALE_STRING); - $this->connection->writeToCache('getUserGroups'.$uid, $groups); + $this->connection->writeToCache($cacheKey, $groups); return $groups; } |