2014-09-29 12:27:11 +02:00
|
|
|
<?php
|
|
|
|
// {{{ICINGA_LICENSE_HEADER}}}
|
|
|
|
// {{{ICINGA_LICENSE_HEADER}}}
|
|
|
|
|
2014-11-14 11:01:16 +01:00
|
|
|
namespace Icinga\Module\Setup\Forms;
|
2014-09-29 12:27:11 +02:00
|
|
|
|
|
|
|
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)
|
|
|
|
{
|
2014-11-11 15:27:14 +01:00
|
|
|
$this->addElement(
|
2014-11-14 10:15:11 +01:00
|
|
|
'note',
|
|
|
|
'title',
|
|
|
|
array(
|
2015-01-19 11:07:39 +01:00
|
|
|
'value' => $this->translate('Authentication', 'setup.page.title'),
|
2014-11-14 10:15:11 +01:00
|
|
|
'decorators' => array(
|
|
|
|
'ViewHelper',
|
|
|
|
array('HtmlTag', array('tag' => 'h2'))
|
2014-11-11 15:27:14 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
);
|
2014-09-29 12:27:11 +02:00
|
|
|
$this->addElement(
|
2014-11-14 10:15:11 +01:00
|
|
|
'note',
|
|
|
|
'description',
|
|
|
|
array(
|
2015-01-19 11:07:39 +01:00
|
|
|
'value' => $this->translate(
|
2014-11-14 10:15:11 +01: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-12-01 15:38:10 +01:00
|
|
|
if (Platform::hasMysqlSupport() || Platform::hasPostgresqlSupport()) {
|
2015-01-19 11:07:39 +01:00
|
|
|
$backendTypes['db'] = $this->translate('Database');
|
2014-09-29 12:27:11 +02:00
|
|
|
}
|
|
|
|
if (Platform::extensionLoaded('ldap')) {
|
|
|
|
$backendTypes['ldap'] = 'LDAP';
|
|
|
|
}
|
2015-01-19 11:07:39 +01:00
|
|
|
$backendTypes['autologin'] = $this->translate('Autologin');
|
2014-09-29 12:27:11 +02:00
|
|
|
|
|
|
|
$this->addElement(
|
|
|
|
'select',
|
|
|
|
'type',
|
|
|
|
array(
|
|
|
|
'required' => true,
|
2015-01-19 11:07:39 +01:00
|
|
|
'label' => $this->translate('Authentication Type'),
|
|
|
|
'description' => $this->translate('The type of authentication to use when accessing Icinga Web 2'),
|
2014-09-29 12:27:11 +02:00
|
|
|
'multiOptions' => $backendTypes
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|