AuthBackendPage: Do only create a resource config if necessary

This commit is contained in:
Johannes Meyer 2015-07-02 10:18:37 +02:00
parent 3b63868ed9
commit f0d7629209

View File

@ -121,7 +121,7 @@ class AuthBackendPage extends Form
return false; return false;
} }
if (false === isset($data['skip_validation']) || $data['skip_validation'] == 0) { if ($this->config['type'] === 'ldap' && ( !isset($data['skip_validation']) || $data['skip_validation'] == 0)) {
$self = clone $this; $self = clone $this;
$self->addElement( $self->addElement(
'text', 'text',
@ -130,7 +130,7 @@ class AuthBackendPage extends Form
'value' => $this->getResourceConfig() 'value' => $this->getResourceConfig()
) )
); );
if ($this->config['type'] === 'ldap' && false === LdapBackendForm::isValidUserBackend($self)) { if (! LdapBackendForm::isValidUserBackend($self)) {
$this->addSkipValidationCheckbox(); $this->addSkipValidationCheckbox();
return false; return false;
} }