]> source.dussan.org Git - nextcloud-server.git/commitdiff
LDAP: fix cache save and check, fixes oc-2118
authorArthur Schiwon <blizzz@owncloud.com>
Mon, 22 Oct 2012 20:46:28 +0000 (22:46 +0200)
committerArthur Schiwon <blizzz@owncloud.com>
Mon, 22 Oct 2012 20:46:28 +0000 (22:46 +0200)
apps/user_ldap/group_ldap.php

index bd9f7e0c552b567732264488a28e456078294446..9780fc75f9e9821eb7b1ae4405d285164867c945 100644 (file)
@@ -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;
        }