mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-21 12:54:26 +02:00
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(
|
array(
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'label' => t('Backend Name'),
|
'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(
|
'validators' => array(
|
||||||
array(
|
array(
|
||||||
'Regex',
|
'Regex',
|
||||||
@ -50,8 +52,8 @@ class AutologinBackendForm extends Form
|
|||||||
'text',
|
'text',
|
||||||
'strip_username_regexp',
|
'strip_username_regexp',
|
||||||
array(
|
array(
|
||||||
'label' => t('Backend Domain Pattern'),
|
'label' => t('Filter Pattern'),
|
||||||
'description' => t('The domain pattern of this authentication backend'),
|
'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' => '/\@[^$]+$/',
|
'value' => '/\@[^$]+$/',
|
||||||
'validators' => array(
|
'validators' => array(
|
||||||
new Zend_Validate_Callback(function ($value) {
|
new Zend_Validate_Callback(function ($value) {
|
||||||
|
@ -54,7 +54,9 @@ class DbBackendForm extends Form
|
|||||||
array(
|
array(
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'label' => t('Backend Name'),
|
'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(
|
$this->addElement(
|
||||||
|
@ -55,7 +55,9 @@ class LdapBackendForm extends Form
|
|||||||
array(
|
array(
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'label' => t('Backend Name'),
|
'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(
|
$this->addElement(
|
||||||
|
@ -59,21 +59,28 @@ class AuthBackendPage extends Form
|
|||||||
*/
|
*/
|
||||||
public function createElements(array $formData)
|
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(
|
$this->addElement(
|
||||||
new Note(
|
new Note(
|
||||||
'description',
|
'description',
|
||||||
array(
|
array('value' => $note)
|
||||||
'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')
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user