[Pkg-owncloud-commits] [owncloud] 32/394: LDAP: clear the cache not only when TTL changes, but with every settings update. Fixes #194

David Prévot taffit at alioth.debian.org
Fri Nov 8 23:11:20 UTC 2013


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

taffit pushed a commit to annotated tag v4.5.10
in repository owncloud.

commit c64f579518ab71e55630a85ba385c76b43afd3d8
Author: Arthur Schiwon <blizzz at owncloud.com>
Date:   Thu Nov 1 16:48:17 2012 +0100

    LDAP: clear the cache not only when TTL changes, but with every settings update. Fixes #194
---
 apps/user_ldap/settings.php |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/apps/user_ldap/settings.php b/apps/user_ldap/settings.php
index f765151..ca9855d 100644
--- a/apps/user_ldap/settings.php
+++ b/apps/user_ldap/settings.php
@@ -26,16 +26,12 @@ OCP\Util::addscript('user_ldap', 'settings');
 OCP\Util::addstyle('user_ldap', 'settings');
 
 if ($_POST) {
+	$clearCache = false;
 	foreach($params as $param) {
 		if(isset($_POST[$param])) {
+			$clearCache = true;
 			if('ldap_agent_password' == $param) {
 				OCP\Config::setAppValue('user_ldap', $param, base64_encode($_POST[$param]));
-			} elseif('ldap_cache_ttl' == $param) {
-				if(OCP\Config::getAppValue('user_ldap', $param,'') != $_POST[$param]) {
-					$ldap = new \OCA\user_ldap\lib\Connection('user_ldap');
-					$ldap->clearCache();
-					OCP\Config::setAppValue('user_ldap', $param, $_POST[$param]);
-				}
 			} elseif('home_folder_naming_rule' == $param) {
 				$value = empty($_POST[$param]) ? 'opt:username' : 'attr:'.$_POST[$param];
 				OCP\Config::setAppValue('user_ldap', $param, $value);
@@ -54,6 +50,10 @@ if ($_POST) {
 			OCP\Config::setAppValue('user_ldap', $param, 0);
 		}
 	}
+	if($clearCache){
+		$ldap = new \OCA\user_ldap\lib\Connection('user_ldap');
+		$ldap->clearCache();
+	}
 }
 
 // fill template

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