summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-05-08 11:06:00 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-05-08 11:06:00 +0200
commite4c05acf94cf799c5e7df67056c1c8d64089323e (patch)
treef900a1c1e0294e8c019a6dedff937ce92bf998af /apps/user_ldap
parentdfd451777c27be2ab7828910ebe2199735909d62 (diff)
parent57e8b76f4809aab59bf5f46e722b204211b36fdd (diff)
downloadnextcloud-server-e4c05acf94cf799c5e7df67056c1c8d64089323e.tar.gz
nextcloud-server-e4c05acf94cf799c5e7df67056c1c8d64089323e.zip
Merge pull request #16170 from owncloud/fix-15621
drop global file cache support, fixes #15621
Diffstat (limited to 'apps/user_ldap')
-rw-r--r--apps/user_ldap/lib/connection.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php
index b9d83aad684..d6f4bdcde04 100644
--- a/apps/user_ldap/lib/connection.php
+++ b/apps/user_ldap/lib/connection.php
@@ -78,8 +78,6 @@ class Connection extends LDAPUtility {
$memcache = \OC::$server->getMemCacheFactory();
if($memcache->isAvailable()) {
$this->cache = $memcache->create();
- } else {
- $this->cache = \OC\Cache::getGlobalCache();
}
$this->hasPagedResultSupport =
$this->ldap->hasPagedResultSupport();
@@ -195,7 +193,7 @@ class Connection extends LDAPUtility {
if(!$this->configured) {
$this->readConfiguration();
}
- if(!$this->configuration->ldapCacheTTL) {
+ if(is_null($this->cache) || !$this->configuration->ldapCacheTTL) {
return null;
}
if(!$this->isCached($key)) {
@@ -215,7 +213,7 @@ class Connection extends LDAPUtility {
if(!$this->configured) {
$this->readConfiguration();
}
- if(!$this->configuration->ldapCacheTTL) {
+ if(is_null($this->cache) || !$this->configuration->ldapCacheTTL) {
return false;
}
$key = $this->getCacheKey($key);
@@ -225,12 +223,15 @@ class Connection extends LDAPUtility {
/**
* @param string $key
* @param mixed $value
+ *
+ * @return string
*/
public function writeToCache($key, $value) {
if(!$this->configured) {
$this->readConfiguration();
}
- if(!$this->configuration->ldapCacheTTL
+ if(is_null($this->cache)
+ || !$this->configuration->ldapCacheTTL
|| !$this->configuration->ldapConfigurationActive) {
return null;
}
@@ -240,7 +241,9 @@ class Connection extends LDAPUtility {
}
public function clearCache() {
- $this->cache->clear($this->getCacheKey(null));
+ if(!is_null($this->cache)) {
+ $this->cache->clear($this->getCacheKey(null));
+ }
}
/**