mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
make all this work in an early configuration state in the wizard by marking the config active and ignoring the validation state.
This commit is contained in:
parent
c491fa272e
commit
0ba9a6b73d
2 changed files with 15 additions and 1 deletions
|
|
@ -41,6 +41,8 @@ class Connection extends LDAPUtility {
|
|||
|
||||
protected $doNotValidate = false;
|
||||
|
||||
protected $ignoreValidation = false;
|
||||
|
||||
/**
|
||||
* @brief Constructor
|
||||
* @param \OCA\user_ldap\lib\ILDAPWrapper $ldap
|
||||
|
|
@ -108,6 +110,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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue