summaryrefslogtreecommitdiffstats
path: root/application/forms/Config/General/DefaultAuthenticationDomainConfigForm.php
blob: 0ff6c3263553c85dee5d2f73066fca2c97deb5ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?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 Login 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 for the user. Note that if none your LDAP authentication'
                    . ' backends are configured to be responsible for this domain or if none of your authentication'
                    . ' backends holds usernames with the domain part, users will not be able to login.'
                )
            )
        );

        return $this;
    }
}