2014-09-29 12:26:27 +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:26:27 +02:00
|
|
|
|
|
|
|
use Icinga\Application\Icinga;
|
|
|
|
use Icinga\Web\Form;
|
2014-11-10 16:31:40 +01:00
|
|
|
use Icinga\Module\Setup\Web\Form\Validator\TokenValidator;
|
2014-09-29 12:26:27 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Wizard page to authenticate and welcome the user
|
|
|
|
*/
|
|
|
|
class WelcomePage extends Form
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Initialize this page
|
|
|
|
*/
|
|
|
|
public function init()
|
|
|
|
{
|
2014-10-01 10:33:06 +02:00
|
|
|
$this->setName('setup_welcome');
|
2014-10-28 17:32:49 +01:00
|
|
|
$this->setViewScript('form/setup-welcome.phtml');
|
2014-09-29 12:26:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @see Form::createElements()
|
|
|
|
*/
|
|
|
|
public function createElements(array $formData)
|
|
|
|
{
|
|
|
|
$this->addElement(
|
|
|
|
'text',
|
|
|
|
'token',
|
|
|
|
array(
|
|
|
|
'required' => true,
|
2014-11-11 09:24:53 +01:00
|
|
|
'label' => mt('setup', 'Setup Token'),
|
|
|
|
'description' => mt(
|
|
|
|
'setup',
|
2014-10-29 11:36:03 +01:00
|
|
|
'For security reasons we need to ensure that you are permitted to run this wizard.'
|
|
|
|
. ' Please provide a token by following the instructions below.'
|
2014-10-28 17:32:49 +01:00
|
|
|
),
|
2014-09-29 12:26:27 +02:00
|
|
|
'validators' => array(new TokenValidator(Icinga::app()->getConfigDir() . '/setup.token'))
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|