mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-21 12:54:26 +02:00
Merge branch 'bugfix/wizard-ldap-connection-settings-discovery-failure-reasons-are-silented-2865'
fixes #2865
This commit is contained in:
commit
ee7fa2c48c
@ -81,6 +81,16 @@ class Discovery
|
|||||||
return $this->connection->discoverySuccessful();
|
return $this->connection->discoverySuccessful();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Why the discovery failed
|
||||||
|
*
|
||||||
|
* @return \Exception|null
|
||||||
|
*/
|
||||||
|
public function getError()
|
||||||
|
{
|
||||||
|
return $this->connection->getDiscoveryError();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Discover LDAP servers on the given domain
|
* Discover LDAP servers on the given domain
|
||||||
*
|
*
|
||||||
|
@ -153,6 +153,13 @@ class LdapConnection implements Selectable, Inspectable
|
|||||||
*/
|
*/
|
||||||
protected $discoverySuccess;
|
protected $discoverySuccess;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The cause of the discovery's failure
|
||||||
|
*
|
||||||
|
* @var Exception|null
|
||||||
|
*/
|
||||||
|
private $discoveryError;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the current connection is encrypted
|
* Whether the current connection is encrypted
|
||||||
*
|
*
|
||||||
@ -250,11 +257,13 @@ class LdapConnection implements Selectable, Inspectable
|
|||||||
try {
|
try {
|
||||||
$this->capabilities = LdapCapabilities::discoverCapabilities($this);
|
$this->capabilities = LdapCapabilities::discoverCapabilities($this);
|
||||||
$this->discoverySuccess = true;
|
$this->discoverySuccess = true;
|
||||||
|
$this->discoveryError = null;
|
||||||
} catch (LdapException $e) {
|
} catch (LdapException $e) {
|
||||||
Logger::debug($e);
|
Logger::debug($e);
|
||||||
Logger::warning('LADP discovery failed, assuming default LDAP capabilities.');
|
Logger::warning('LADP discovery failed, assuming default LDAP capabilities.');
|
||||||
$this->capabilities = new LdapCapabilities(); // create empty default capabilities
|
$this->capabilities = new LdapCapabilities(); // create empty default capabilities
|
||||||
$this->discoverySuccess = false;
|
$this->discoverySuccess = false;
|
||||||
|
$this->discoveryError = $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -275,6 +284,16 @@ class LdapConnection implements Selectable, Inspectable
|
|||||||
return $this->discoverySuccess;
|
return $this->discoverySuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get discovery error if any
|
||||||
|
*
|
||||||
|
* @return Exception|null
|
||||||
|
*/
|
||||||
|
public function getDiscoveryError()
|
||||||
|
{
|
||||||
|
return $this->discoveryError;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return whether the current connection is encrypted
|
* Return whether the current connection is encrypted
|
||||||
*
|
*
|
||||||
|
@ -74,6 +74,8 @@ class LdapDiscoveryPage extends Form
|
|||||||
$this->discovery = Discovery::discoverDomain($data['domain']);
|
$this->discovery = Discovery::discoverDomain($data['domain']);
|
||||||
if ($this->discovery->isSuccess()) {
|
if ($this->discovery->isSuccess()) {
|
||||||
return true;
|
return true;
|
||||||
|
} else {
|
||||||
|
$this->error($this->discovery->getError()->getMessage());
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$this->error(sprintf(
|
$this->error(sprintf(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user