AuthBackendPage: Fix that re-populating the chosen LDAP type has no effect

...
This commit is contained in:
Johannes Meyer 2015-07-30 14:51:51 +02:00
parent eb4e56fbc0
commit 87deda86be
2 changed files with 12 additions and 4 deletions

View File

@ -71,6 +71,12 @@ class AuthBackendPage extends Form
. 'to do now is defining a name for your first authentication backend.' . 'to do now is defining a name for your first authentication backend.'
)); ));
} elseif ($this->config['type'] === 'ldap') { } elseif ($this->config['type'] === 'ldap') {
$type = null;
if (! isset($formData['type']) && isset($formData['backend'])) {
$type = $formData['backend'];
$formData['type'] = $type;
}
$backendForm = new LdapBackendForm(); $backendForm = new LdapBackendForm();
$backendForm->setResources(array($this->config['name'])); $backendForm->setResources(array($this->config['name']));
$backendForm->create($formData); $backendForm->create($formData);
@ -94,7 +100,7 @@ class AuthBackendPage extends Form
'ldap' => 'LDAP', 'ldap' => 'LDAP',
'msldap' => 'ActiveDirectory' 'msldap' => 'ActiveDirectory'
), ),
'value' => isset($formData['backend']) ? $formData['backend'] : null 'value' => $type
) )
); );
} else { // $this->config['type'] === 'external' } else { // $this->config['type'] === 'external'

View File

@ -138,10 +138,12 @@ class WebWizard extends Wizard implements SetupWizard
} elseif ($authData['type'] === 'ldap') { } elseif ($authData['type'] === 'ldap') {
$page->setResourceConfig($this->getPageData('setup_ldap_resource')); $page->setResourceConfig($this->getPageData('setup_ldap_resource'));
if (! $this->hasPageData('setup_authentication_backend')) {
$suggestions = $this->getPageData('setup_ldap_discovery'); $suggestions = $this->getPageData('setup_ldap_discovery');
if (isset($suggestions['backend'])) { if (isset($suggestions['backend'])) {
$page->populate($suggestions['backend']); $page->populate($suggestions['backend']);
} }
}
if ($this->getDirection() === static::FORWARD) { if ($this->getDirection() === static::FORWARD) {
$backendConfig = $this->getPageData('setup_authentication_backend'); $backendConfig = $this->getPageData('setup_authentication_backend');