icingaweb2/application/forms/Setup/WelcomePage.php

58 lines
1.4 KiB
PHP
Raw Normal View History

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;
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()
{
$this->setName('setup_welcome');
2014-09-29 12:26:27 +02:00
}
/**
* @see Form::createElements()
*/
public function createElements(array $formData)
{
$this->addElement(
new Note(
'welcome',
array(
'value' => t('%WELCOME%')
)
2014-09-29 12:26:27 +02:00
)
);
$this->addElement(
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'))
)
);
}
}