mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
parent
a39c6a475a
commit
b1c32b1821
61
application/forms/Setup/AuthenticationPage.php
Normal file
61
application/forms/Setup/AuthenticationPage.php
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
<?php
|
||||||
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
|
||||||
|
namespace Icinga\Form\Setup;
|
||||||
|
|
||||||
|
use Icinga\Web\Form;
|
||||||
|
use Icinga\Application\Platform;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wizard page to choose an authentication backend
|
||||||
|
*/
|
||||||
|
class AuthenticationPage extends Form
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Initialize this page
|
||||||
|
*/
|
||||||
|
public function init()
|
||||||
|
{
|
||||||
|
$this->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
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user