Skip to content

Commit

Permalink
Add more detailed explanations when configuring authentication backends
Browse files Browse the repository at this point in the history
refs #7163
fixes #7411
  • Loading branch information
Johannes Meyer committed Oct 21, 2014
1 parent b4a6979 commit 3a3d29e
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 17 deletions.
Expand Up @@ -31,7 +31,9 @@ public function createElements(array $formData)
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',
Expand All @@ -50,8 +52,8 @@ public function createElements(array $formData)
'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) {
Expand Down
4 changes: 3 additions & 1 deletion application/forms/Config/Authentication/DbBackendForm.php
Expand Up @@ -54,7 +54,9 @@ public function createElements(array $formData)
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(
Expand Down
4 changes: 3 additions & 1 deletion application/forms/Config/Authentication/LdapBackendForm.php
Expand Up @@ -55,7 +55,9 @@ public function createElements(array $formData)
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(
Expand Down
31 changes: 19 additions & 12 deletions application/forms/Setup/AuthBackendPage.php
Expand Up @@ -59,21 +59,28 @@ public function getResourceConfig()
*/
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)
)
);

Expand Down

0 comments on commit 3a3d29e

Please sign in to comment.