Catch errors occuring on ldap discoveries

fixes #8656
This commit is contained in:
Johannes Meyer 2015-03-10 13:24:54 +01:00
parent d0383a241e
commit f87a43b9d3

View File

@ -3,6 +3,7 @@
namespace Icinga\Module\Setup\Forms; namespace Icinga\Module\Setup\Forms;
use Exception;
use Zend_Validate_NotEmpty; use Zend_Validate_NotEmpty;
use Icinga\Web\Form; use Icinga\Web\Form;
use Icinga\Web\Form\ErrorLabeller; use Icinga\Web\Form\ErrorLabeller;
@ -68,10 +69,13 @@ class LdapDiscoveryPage extends Form
} }
if (isset($data['domain']) && $data['domain']) { if (isset($data['domain']) && $data['domain']) {
try {
$this->discovery = Discovery::discoverDomain($data['domain']); $this->discovery = Discovery::discoverDomain($data['domain']);
if ($this->discovery->isSuccess()) { if ($this->discovery->isSuccess()) {
return true; return true;
} }
} catch (Exception $e) {
}
$this->addError( $this->addError(
sprintf($this->translate('Could not find any LDAP servers on the domain "%s".'), $data['domain']) sprintf($this->translate('Could not find any LDAP servers on the domain "%s".'), $data['domain'])