icingaweb2/modules/setup/application/forms/WelcomePage.php

46 lines
1.2 KiB
PHP
Raw Normal View History

2014-09-29 12:26:27 +02:00
<?php
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Module\Setup\Form;
2014-09-29 12:26:27 +02:00
use Icinga\Application\Icinga;
use Icinga\Web\Form;
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()
{
$this->setName('setup_welcome');
$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,
'label' => mt('setup', 'Setup Token'),
'description' => mt(
'setup',
'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-09-29 12:26:27 +02:00
'validators' => array(new TokenValidator(Icinga::app()->getConfigDir() . '/setup.token'))
)
);
}
}