Add welcome page

refs #7163
This commit is contained in:
Johannes Meyer 2014-09-29 12:26:27 +02:00
parent 929344e68b
commit 226575eddd
1 changed files with 54 additions and 0 deletions

View File

@ -0,0 +1,54 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Form\Setup;
use Icinga\Application\Icinga;
use Icinga\Web\Form;
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('form_setup_welcome');
}
/**
* @see Form::createElements()
*/
public function createElements(array $formData)
{
$this->addElement(
'note',
'welcome',
array(
'value' => t('%WELCOME%')
)
);
$this->addElement(
'note',
'description',
array(
'value' => t('%DESCRIPTION%')
)
);
$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'))
)
);
}
}