From 3a3d29ea4fc49798e4047f5622b71b5b47bfad76 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 21 Oct 2014 16:15:04 +0200 Subject: [PATCH] Add more detailed explanations when configuring authentication backends refs #7163 fixes #7411 --- .../Authentication/AutologinBackendForm.php | 8 +++-- .../Config/Authentication/DbBackendForm.php | 4 ++- .../Config/Authentication/LdapBackendForm.php | 4 ++- application/forms/Setup/AuthBackendPage.php | 31 ++++++++++++------- 4 files changed, 30 insertions(+), 17 deletions(-) diff --git a/application/forms/Config/Authentication/AutologinBackendForm.php b/application/forms/Config/Authentication/AutologinBackendForm.php index 757db4b70f..0a53de6bde 100644 --- a/application/forms/Config/Authentication/AutologinBackendForm.php +++ b/application/forms/Config/Authentication/AutologinBackendForm.php @@ -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', @@ -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) { diff --git a/application/forms/Config/Authentication/DbBackendForm.php b/application/forms/Config/Authentication/DbBackendForm.php index de86d8b245..17bf9a5fd1 100644 --- a/application/forms/Config/Authentication/DbBackendForm.php +++ b/application/forms/Config/Authentication/DbBackendForm.php @@ -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( diff --git a/application/forms/Config/Authentication/LdapBackendForm.php b/application/forms/Config/Authentication/LdapBackendForm.php index 3d4e3cdf38..61ed4c3f36 100644 --- a/application/forms/Config/Authentication/LdapBackendForm.php +++ b/application/forms/Config/Authentication/LdapBackendForm.php @@ -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( diff --git a/application/forms/Setup/AuthBackendPage.php b/application/forms/Setup/AuthBackendPage.php index 12d3e3f7d0..9439e0b0fc 100644 --- a/application/forms/Setup/AuthBackendPage.php +++ b/application/forms/Setup/AuthBackendPage.php @@ -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) ) );