From b1c32b182108afa4a78f7ccd6bc6c73bb05f09f3 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 29 Sep 2014 12:27:11 +0200 Subject: [PATCH] Add authentication page refs #7163 --- .../forms/Setup/AuthenticationPage.php | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 application/forms/Setup/AuthenticationPage.php diff --git a/application/forms/Setup/AuthenticationPage.php b/application/forms/Setup/AuthenticationPage.php new file mode 100644 index 0000000000..e5e2f1cfcc --- /dev/null +++ b/application/forms/Setup/AuthenticationPage.php @@ -0,0 +1,61 @@ +setName('setup_authentication_type'); + } + + /** + * @see Form::createElements() + */ + public function createElements(array $formData) + { + $this->addElement( + 'note', + 'description', + array( + 'value' => t( + 'Please choose how you want to authenticate when accessing Icinga Web 2.' + . ' Configuring backend specific details follows in a later step.' + ) + ) + ); + + $backendTypes = array(); + if (Platform::extensionLoaded('pdo') && (Platform::zendClassExists('Zend_Db_Adapter_Pdo_Mysql') + || Platform::zendClassExists('Zend_Db_Adapter_Pdo_Pgsql'))) + { + $backendTypes['db'] = t('Database'); + } + if (Platform::extensionLoaded('ldap')) { + $backendTypes['ldap'] = 'LDAP'; + } + $backendTypes['autologin'] = t('Autologin'); + + $this->addElement( + 'select', + 'type', + array( + 'required' => true, + 'label' => t('Authentication Type'), + 'description' => t('The type of authentication to use when accessing Icinga Web 2'), + 'multiOptions' => $backendTypes + ) + ); + } +}