mirror of
https://github.com/Icinga/icingaweb2.git
synced 2026-07-08 01:01:07 -04:00
45 lines
946 B
PHP
45 lines
946 B
PHP
<?php
|
|
|
|
namespace Icinga\Forms\Authentication;
|
|
|
|
use Icinga\Web\Form;
|
|
use Icinga\Web\Session;
|
|
use Icinga\Web\Url;
|
|
|
|
class Cancel2FAForm extends Form
|
|
{
|
|
public function init()
|
|
{
|
|
$this->setRequiredCue(null);
|
|
$this->setName('form_cancel_2fa');
|
|
$this->setSubmitLabel($this->translate('Cancel'));
|
|
$this->setProgressLabel($this->translate('Canceling'));
|
|
$this->setAttrib('class', 'content-centered');
|
|
}
|
|
|
|
public function createElements(array $formData)
|
|
{
|
|
$this->addElement(
|
|
'hidden',
|
|
'redirect',
|
|
[
|
|
'value' => Url::fromRequest()->getParam('redirect')
|
|
]
|
|
);
|
|
|
|
$this->addElement(
|
|
'hidden',
|
|
'cancel_2fa',
|
|
[
|
|
'value' => true
|
|
]
|
|
);
|
|
}
|
|
|
|
public function onSuccess()
|
|
{
|
|
Session::getSession()->purge();
|
|
|
|
return true;
|
|
}
|
|
}
|