2014-09-29 12:26:27 +02:00
|
|
|
<?php
|
|
|
|
// {{{ICINGA_LICENSE_HEADER}}}
|
|
|
|
// {{{ICINGA_LICENSE_HEADER}}}
|
|
|
|
|
|
|
|
namespace Icinga\Form\Setup;
|
|
|
|
|
|
|
|
use Icinga\Application\Icinga;
|
|
|
|
use Icinga\Web\Form;
|
2014-09-29 15:46:30 +02:00
|
|
|
use Icinga\Web\Form\Element\Note;
|
2014-09-29 12:26:27 +02:00
|
|
|
use Icinga\Web\Form\Validator\TokenValidator;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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-09-29 12:26:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @see Form::createElements()
|
|
|
|
*/
|
|
|
|
public function createElements(array $formData)
|
|
|
|
{
|
|
|
|
$this->addElement(
|
2014-09-29 15:46:30 +02:00
|
|
|
new Note(
|
|
|
|
'welcome',
|
|
|
|
array(
|
|
|
|
'value' => t('%WELCOME%')
|
|
|
|
)
|
2014-09-29 12:26:27 +02:00
|
|
|
)
|
|
|
|
);
|
|
|
|
$this->addElement(
|
2014-09-29 15:46:30 +02:00
|
|
|
new Note(
|
|
|
|
'description',
|
|
|
|
array(
|
|
|
|
'value' => t('%DESCRIPTION%')
|
|
|
|
)
|
2014-09-29 12:26:27 +02:00
|
|
|
)
|
|
|
|
);
|
|
|
|
$this->addElement(
|
|
|
|
'text',
|
|
|
|
'token',
|
|
|
|
array(
|
|
|
|
'required' => true,
|
|
|
|
'label' => t('Setup Token'),
|
|
|
|
'description' => t('Please enter the setup token you\'ve created earlier by using the icingacli'),
|
|
|
|
'validators' => array(new TokenValidator(Icinga::app()->getConfigDir() . '/setup.token'))
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|