Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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')) | ||
) | ||
); | ||
} | ||
} |