Setup: Provide a default user filter for ActiveDirectory backends

fixes #8703
This commit is contained in:
Johannes Meyer 2015-06-25 14:22:50 +02:00
parent 86bdf81396
commit d95874b84c
2 changed files with 24 additions and 5 deletions

View File

@ -92,17 +92,19 @@ class LdapBackendForm extends Form
'text', 'text',
'filter', 'filter',
array( array(
'allowEmpty' => true, 'preserveDefault' => true,
'label' => $this->translate('LDAP Filter'), 'allowEmpty' => true,
'description' => $this->translate( 'value' => $isAd ? '!(objectClass=computer)' : null,
'label' => $this->translate('LDAP Filter'),
'description' => $this->translate(
'An additional filter to use when looking up users using the specified connection. ' 'An additional filter to use when looking up users using the specified connection. '
. 'Leave empty to not to use any additional filter rules.' . 'Leave empty to not to use any additional filter rules.'
), ),
'requirement' => $this->translate( 'requirement' => $this->translate(
'The filter needs to be expressed as standard LDAP expression.' 'The filter needs to be expressed as standard LDAP expression.'
. ' (e.g. &(foo=bar)(bar=foo) or foo=bar)' . ' (e.g. &(foo=bar)(bar=foo) or foo=bar)'
), ),
'validators' => array( 'validators' => array(
array( array(
'Callback', 'Callback',
false, false,

View File

@ -78,6 +78,23 @@ class AuthBackendPage extends Form
'Before you are able to authenticate using the LDAP connection defined earlier you need to' 'Before you are able to authenticate using the LDAP connection defined earlier you need to'
. ' provide some more information so that Icinga Web 2 is able to locate account details.' . ' provide some more information so that Icinga Web 2 is able to locate account details.'
)); ));
$this->addElement(
'select',
'type',
array(
'ignore' => true,
'required' => true,
'autosubmit' => true,
'label' => $this->translate('Backend Type'),
'description' => $this->translate(
'The type of the resource being used for this authenticaton provider'
),
'multiOptions' => array(
'ldap' => 'LDAP',
'msldap' => 'ActiveDirectory'
)
)
);
} else { // $this->config['type'] === 'external' } else { // $this->config['type'] === 'external'
$backendForm = new ExternalBackendForm(); $backendForm = new ExternalBackendForm();
$backendForm->createElements($formData); $backendForm->createElements($formData);