summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2013-10-24 20:26:05 +0200
committerArthur Schiwon <blizzz@owncloud.com>2013-10-24 20:26:05 +0200
commitc48157e3b85f3daa4a68ef83d7534df6a59d5c78 (patch)
tree18ea183e195540299a5a1b01e029acf6bd25a8a2 /apps
parent7fa418c81a0d6a159d126099b853d8b083c70ff5 (diff)
downloadnextcloud-server-c48157e3b85f3daa4a68ef83d7534df6a59d5c78.tar.gz
nextcloud-server-c48157e3b85f3daa4a68ef83d7534df6a59d5c78.zip
LDAP: don't validate unconfigured (new) LDAP server configs, fixes #5518
Diffstat (limited to 'apps')
-rw-r--r--apps/user_ldap/lib/connection.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php
index 8d34fb2f418..14dfaa1174d 100644
--- a/apps/user_ldap/lib/connection.php
+++ b/apps/user_ldap/lib/connection.php
@@ -39,6 +39,8 @@ class Connection extends LDAPUtility {
//settings handler
protected $configuration;
+ protected $doNotValidate = false;
+
/**
* @brief Constructor
* @param $configPrefix a string with the prefix for the configkey column (appconfig table)
@@ -57,6 +59,8 @@ class Connection extends LDAPUtility {
}
$this->hasPagedResultSupport =
$this->ldap->hasPagedResultSupport();
+ $this->doNotValidate = !in_array($this->configPrefix,
+ Helper::getServerConfigurationPrefixes());
}
public function __destruct() {
@@ -88,6 +92,7 @@ class Connection extends LDAPUtility {
}
public function __set($name, $value) {
+ $this->doNotValidate = false;
$before = $this->configuration->$name;
$this->configuration->$name = $value;
$after = $this->configuration->$name;
@@ -201,11 +206,13 @@ class Connection extends LDAPUtility {
if(is_null($setParameters)) {
$setParameters = array();
}
+ $this->doNotValidate = false;
$this->configuration->setConfiguration($config, $setParameters);
if(count($setParameters) > 0) {
$this->configured = $this->validateConfiguration();
}
+
return $this->configured;
}
@@ -401,6 +408,14 @@ class Connection extends LDAPUtility {
* @returns true if configuration seems OK, false otherwise
*/
private function validateConfiguration() {
+
+ if($this->doNotValidate) {
+ //don't do a validation if it is a new configuration with pure
+ //default values. Will be allowed on changes via __set or
+ //setConfiguration
+ return false;
+ }
+
// first step: "soft" checks: settings that are not really
// necessary, but advisable. If left empty, give an info message
$this->doSoftValidation();