[Pkg-owncloud-commits] [owncloud] 07/21: make all this work in an early configuration state in the wizard by marking the config active and ignoring the validation state.

David Prévot taffit at moszumanska.debian.org
Sat Jun 28 18:44:56 UTC 2014


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

taffit pushed a commit to branch 6.0
in repository owncloud.

commit 0ba9a6b73d091df40faa1f917c8ad8a014902e34
Author: Arthur Schiwon <blizzz at owncloud.com>
Date:   Wed Jun 11 22:36:40 2014 +0200

    make all this work in an early configuration state in the wizard by marking  the config active and ignoring the validation state.
---
 apps/user_ldap/lib/connection.php | 14 +++++++++++++-
 apps/user_ldap/lib/wizard.php     |  2 ++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php
index a4b9d1c..01801ea 100644
--- a/apps/user_ldap/lib/connection.php
+++ b/apps/user_ldap/lib/connection.php
@@ -41,6 +41,8 @@ class Connection extends LDAPUtility {
 
 	protected $doNotValidate = false;
 
+	protected $ignoreValidation = false;
+
 	/**
 	 * @brief Constructor
 	 * @param \OCA\user_ldap\lib\ILDAPWrapper $ldap
@@ -109,6 +111,16 @@ class Connection extends LDAPUtility {
 	}
 
 	/**
+	 * sets whether the result of the configuration validation shall
+	 * be ignored when establishing the connection. Used by the Wizard
+	 * in early configuration state.
+	 * @param bool $state
+	 */
+	public function setIgnoreValidation($state) {
+		$this->ignoreValidation = (bool)$state;
+	}
+
+	/**
 	 * @brief initializes the LDAP backend
 	 * @param $force read the config settings no matter what
 	 *
@@ -441,7 +453,7 @@ class Connection extends LDAPUtility {
 		if(!$phpLDAPinstalled) {
 			return false;
 		}
-		if(!$this->configured) {
+		if(!$this->ignoreValidation && !$this->configured) {
 			\OCP\Util::writeLog('user_ldap',
 								'Configuration is invalid, cannot connect',
 								\OCP\Util::WARN);
diff --git a/apps/user_ldap/lib/wizard.php b/apps/user_ldap/lib/wizard.php
index c5e9eb6..4766451 100644
--- a/apps/user_ldap/lib/wizard.php
+++ b/apps/user_ldap/lib/wizard.php
@@ -1072,6 +1072,8 @@ class Wizard extends LDAPUtility {
 	private function getAccess() {
 		$con = new Connection($this->ldap, '', null);
 		$con->setConfiguration($this->configuration->getConfiguration());
+		$con->ldapConfigurationActive = true;
+		$con->setIgnoreValidation(true);
 		$ldapAccess = new Access($con, $this->ldap);
 		return $ldapAccess;
 	}

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