Add more detailed explanations when configuring authentication backends
refs #7163 fixes #7411
This commit is contained in:
parent
b4a69792d8
commit
3a3d29ea4f
|
@ -31,7 +31,9 @@ class AutologinBackendForm extends Form
|
|||
array(
|
||||
'required' => true,
|
||||
'label' => t('Backend Name'),
|
||||
'description' => t('The name of this authentication backend'),
|
||||
'description' => t(
|
||||
'The name of this authentication provider that is used to differentiate it from others'
|
||||
),
|
||||
'validators' => array(
|
||||
array(
|
||||
'Regex',
|
||||
|
@ -50,8 +52,8 @@ class AutologinBackendForm extends Form
|
|||
'text',
|
||||
'strip_username_regexp',
|
||||
array(
|
||||
'label' => t('Backend Domain Pattern'),
|
||||
'description' => t('The domain pattern of this authentication backend'),
|
||||
'label' => t('Filter Pattern'),
|
||||
'description' => t('The regular expression to use to strip specific parts off from usernames. Leave empty if you do not want to strip off anything'),
|
||||
'value' => '/\@[^$]+$/',
|
||||
'validators' => array(
|
||||
new Zend_Validate_Callback(function ($value) {
|
||||
|
|
|
@ -54,7 +54,9 @@ class DbBackendForm extends Form
|
|||
array(
|
||||
'required' => true,
|
||||
'label' => t('Backend Name'),
|
||||
'description' => t('The name of this authentication provider'),
|
||||
'description' => t(
|
||||
'The name of this authentication provider that is used to differentiate it from others'
|
||||
),
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
|
|
|
@ -55,7 +55,9 @@ class LdapBackendForm extends Form
|
|||
array(
|
||||
'required' => true,
|
||||
'label' => t('Backend Name'),
|
||||
'description' => t('The name of this authentication backend')
|
||||
'description' => t(
|
||||
'The name of this authentication provider that is used to differentiate it from others'
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
|
|
|
@ -59,21 +59,28 @@ class AuthBackendPage extends Form
|
|||
*/
|
||||
public function createElements(array $formData)
|
||||
{
|
||||
$this->config['type'] = 'autologin';
|
||||
if ($this->config['type'] === 'db') {
|
||||
$note = t(
|
||||
'As you\'ve chosen to use a database for authentication all you need '
|
||||
. 'to do now is defining a name for your first authentication backend.'
|
||||
);
|
||||
} elseif ($this->config['type'] === 'ldap') {
|
||||
$note = t(
|
||||
'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.'
|
||||
);
|
||||
} else { // if ($this->config['type'] === 'autologin'
|
||||
$note = t(
|
||||
'You\'ve chosen to authenticate using a web server\'s mechanism so it may be necessary'
|
||||
. ' to adjust usernames before any permissions, restrictions, etc. are being applied.'
|
||||
);
|
||||
}
|
||||
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'description',
|
||||
array(
|
||||
'value' => sprintf(
|
||||
t(
|
||||
'Now please enter all configuration details required'
|
||||
. ' to authenticate using this %s backend.',
|
||||
'setup.auth.backend'
|
||||
),
|
||||
$this->config['type'] === 'db' ? t('database', 'setup.auth.backend.type') : (
|
||||
$this->config['type'] === 'ldap' ? 'LDAP' : t('autologin', 'setup.auth.backend.type')
|
||||
)
|
||||
)
|
||||
)
|
||||
array('value' => $note)
|
||||
)
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue