Drop dependent page data more earlier

Not only the "setup_authentication_backend" page depends on the auth
type but also the "setup_admin_account" page, so just drop both entries
once a new auth type gets submitted.

refs #7163
This commit is contained in:
Johannes Meyer 2014-10-06 16:52:19 +02:00
parent ad7965228c
commit 04ff2e271a

View File

@ -86,15 +86,6 @@ class WebSetup extends Wizard implements SetupWizard
} }
} elseif ($page->getName() === 'setup_authentication_backend') { } elseif ($page->getName() === 'setup_authentication_backend') {
$authData = $this->getPageData('setup_authentication_type'); $authData = $this->getPageData('setup_authentication_type');
if (($backendData = $this->getPageData($page->getName())) !== null
&& $backendData['backend'] !== $authData['type']
) {
// Drop any existing page data in case the authentication type has changed,
// otherwise it will conflict with other forms that depend on this one
$pageData = & $this->getPageData();
unset($pageData[$page->getName()]);
}
if ($authData['type'] === 'db') { if ($authData['type'] === 'db') {
$page->setResourceConfig($this->getPageData('setup_db_resource')); $page->setResourceConfig($this->getPageData('setup_db_resource'));
} elseif ($authData['type'] === 'ldap') { } elseif ($authData['type'] === 'ldap') {
@ -125,6 +116,15 @@ class WebSetup extends Wizard implements SetupWizard
t('The given resource name must be unique and is already in use by the database resource') t('The given resource name must be unique and is already in use by the database resource')
); );
} }
} elseif ($page->getName() === 'setup_authentication_type') {
$authData = $this->getPageData($page->getName());
if ($authData !== null && $request->getPost('type') !== $authData['type']) {
// Drop any existing page data in case the authentication type has changed,
// otherwise it will conflict with other forms that depend on this one
$pageData = & $this->getPageData();
unset($pageData['setup_admin_account']);
unset($pageData['setup_authentication_backend']);
}
} }
} }