2014-09-29 12:27:11 +02:00
|
|
|
<?php
|
|
|
|
// {{{ICINGA_LICENSE_HEADER}}}
|
|
|
|
// {{{ICINGA_LICENSE_HEADER}}}
|
|
|
|
|
2014-11-10 16:31:40 +01:00
|
|
|
namespace Icinga\Module\Setup\Form;
|
2014-09-29 12:27:11 +02:00
|
|
|
|
|
|
|
use Icinga\Web\Form;
|
|
|
|
use Icinga\Application\Platform;
|
2014-09-29 15:46:30 +02:00
|
|
|
use Icinga\Web\Form\Element\Note;
|
2014-09-29 12:27:11 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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(
|
2014-09-29 15:46:30 +02:00
|
|
|
new Note(
|
|
|
|
'description',
|
|
|
|
array(
|
2014-11-11 09:24:53 +01:00
|
|
|
'value' => mt(
|
|
|
|
'setup',
|
2014-09-29 15:46:30 +02:00
|
|
|
'Please choose how you want to authenticate when accessing Icinga Web 2.'
|
|
|
|
. ' Configuring backend specific details follows in a later step.'
|
|
|
|
)
|
2014-09-29 12:27:11 +02:00
|
|
|
)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
$backendTypes = array();
|
2014-11-07 14:31:20 +01:00
|
|
|
if (Platform::extensionLoaded('mysql') || Platform::extensionLoaded('pgsql')) {
|
2014-09-29 12:27:11 +02:00
|
|
|
$backendTypes['db'] = t('Database');
|
|
|
|
}
|
|
|
|
if (Platform::extensionLoaded('ldap')) {
|
|
|
|
$backendTypes['ldap'] = 'LDAP';
|
|
|
|
}
|
|
|
|
$backendTypes['autologin'] = t('Autologin');
|
|
|
|
|
|
|
|
$this->addElement(
|
|
|
|
'select',
|
|
|
|
'type',
|
|
|
|
array(
|
|
|
|
'required' => true,
|
2014-11-11 09:24:53 +01:00
|
|
|
'label' => mt('setup', 'Authentication Type'),
|
|
|
|
'description' => mt('setup', 'The type of authentication to use when accessing Icinga Web 2'),
|
2014-09-29 12:27:11 +02:00
|
|
|
'multiOptions' => $backendTypes
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|