mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-20 12:24:29 +02:00
Fix incorrect form fields being displayed when no database resource exists
This commit is contained in:
parent
94f8745fc0
commit
00ffb34829
@ -281,7 +281,7 @@ class AuthenticationBackendConfigForm extends ConfigForm
|
|||||||
public function createElements(array $formData)
|
public function createElements(array $formData)
|
||||||
{
|
{
|
||||||
$backendTypes = array();
|
$backendTypes = array();
|
||||||
$backendType = isset($formData['type']) ? $formData['type'] : 'db';
|
$backendType = isset($formData['type']) ? $formData['type'] : null;
|
||||||
|
|
||||||
if (isset($this->resources['db'])) {
|
if (isset($this->resources['db'])) {
|
||||||
$backendTypes['db'] = t('Database');
|
$backendTypes['db'] = t('Database');
|
||||||
@ -300,6 +300,10 @@ class AuthenticationBackendConfigForm extends ConfigForm
|
|||||||
$backendTypes['autologin'] = t('Autologin');
|
$backendTypes['autologin'] = t('Autologin');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($backendType === null) {
|
||||||
|
$backendType = key($backendTypes);
|
||||||
|
}
|
||||||
|
|
||||||
$this->addElement(
|
$this->addElement(
|
||||||
'select',
|
'select',
|
||||||
'type',
|
'type',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user