Skip to content

Commit

Permalink
Add welcome page
Browse files Browse the repository at this point in the history
refs #7163
  • Loading branch information
Johannes Meyer committed Sep 29, 2014
1 parent 929344e commit 226575e
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions application/forms/Setup/WelcomePage.php
@@ -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'))
)
);
}
}

0 comments on commit 226575e

Please sign in to comment.