Make a default domain configurable

refs #2153
This commit is contained in:
Alexander A. Klimov 2017-05-31 18:11:37 +02:00
parent 9400bf9224
commit 46c5b30de8
2 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,44 @@
<?php
/* Icinga Web 2 | (c) 2017 Icinga Development Team | GPLv2+ */
namespace Icinga\Forms\Config\General;
use Icinga\Web\Form;
/**
* Configuration form for the default domain for authentication
*
* This form is not used directly but as subform to the {@link GeneralConfigForm}.
*/
class DefaultAuthenticationDomainConfigForm extends Form
{
/**
* {@inheritdoc}
*/
public function init()
{
$this->setName('form_config_general_authentication');
}
/**
* {@inheritdoc}
*
* @return $this
*/
public function createElements(array $formData)
{
$this->addElement(
'text',
'authentication_default_domain',
array(
'label' => $this->translate('Default Domain'),
'description' => $this->translate(
'If a user logs in without specifying any domain (e.g. "jdoe" instead of "jdoe@example.com"),'
. ' this default domain will be assumed.'
)
)
);
return $this;
}
}

View File

@ -4,6 +4,7 @@
namespace Icinga\Forms\Config;
use Icinga\Forms\Config\General\ApplicationConfigForm;
use Icinga\Forms\Config\General\DefaultAuthenticationDomainConfigForm;
use Icinga\Forms\Config\General\LoggingConfigForm;
use Icinga\Forms\Config\General\ThemingConfigForm;
use Icinga\Forms\ConfigForm;
@ -30,8 +31,10 @@ class GeneralConfigForm extends ConfigForm
$appConfigForm = new ApplicationConfigForm();
$loggingConfigForm = new LoggingConfigForm();
$themingConfigForm = new ThemingConfigForm();
$domainConfigForm = new DefaultAuthenticationDomainConfigForm();
$this->addSubForm($appConfigForm->create($formData));
$this->addSubForm($loggingConfigForm->create($formData));
$this->addSubForm($themingConfigForm->create($formData));
$this->addSubForm($domainConfigForm->create($formData));
}
}