Skip to content

Commit 90c1cf1

Browse files
committed
* [MOD] Updated templates
1 parent 045d828 commit 90c1cf1

File tree

3 files changed

+30
-12
lines changed

3 files changed

+30
-12
lines changed

Authenticator/lib/Controllers/AuthenticatorLoginController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ public function indexAction()
6666
$layoutHelper->setPage('authenticator-2fa');
6767
$layoutHelper->initBody();
6868

69-
$this->view->assign('useFixedHeader');
69+
$this->view->assign('useFixedHeader', true);
70+
$this->view->assign('useMenu', false);
7071
$this->view->assign('route', 'authenticator/checkCode');
7172

7273
$this->checkExpireTime($this->userData->getId());

Authenticator/themes/material-blue/views/login/index.inc

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
<?php /** @var \SP\Core\UI\ThemeIcons $icons */ ?>
1+
<?php
2+
/**
3+
* @var \SP\Core\UI\ThemeIcons $icons
4+
* @var \SP\Config\ConfigData $configData
5+
* @var callable $_getvar
6+
* @var \SP\Mvc\View\Template $this
7+
*/
8+
?>
29
<div id="actions" class="authenticator-2fa" align="center">
310
<div id="box-2fa" class="box-form">
411
<form id="frmLogin2fa" action="" method="post" class="form-action"
512
data-onsubmit="twofa/check"
613
data-plugin="Authenticator"
7-
data-action-route="<?php echo $route; ?>"
14+
data-action-route="<?php echo $_getvar('route'); ?>"
815
data-hash="">
916
<fieldset id="resetdata">
1017
<legend><?php echo _t('authenticator', 'Autentificación en 2 pasos'); ?></legend>
@@ -21,9 +28,9 @@
2128
<span class="mdl-checkbox__label"><?php echo _t('authenticator', 'Olvidé mi código'); ?></span>
2229
</label>
2330

24-
<?php if (isset($from, $from_hash)): ?>
25-
<input type="hidden" name="from" value="<?php echo $from; ?>"/>
26-
<input type="hidden" name="h" value="<?php echo $from_hash; ?>"/>
31+
<?php if ($_getvar('from') && $_getvar('from_hash')): ?>
32+
<input type="hidden" name="from" value="<?php echo $_getvar('from'); ?>"/>
33+
<input type="hidden" name="h" value="<?php echo $_getvar('from_hash'); ?>"/>
2734
<?php endif; ?>
2835

2936
<input type="hidden" name="sk" value=""/>

Authenticator/themes/material-blue/views/userpreferences/preferences-security.inc

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
<?php
2-
/** @var $icons \SP\Core\UI\ThemeIcons */
2+
/**
3+
* @var \SP\Core\UI\ThemeIcons $icons
4+
* @var \SP\Config\ConfigData $configData
5+
* @var callable $_getvar
6+
* @var \SP\Mvc\View\Template $this
7+
*/
8+
9+
$chk2FAEnabled = $_getvar('chk2FAEnabled');
310
?>
411

512
<div id="title" class="titleNormal">
@@ -10,7 +17,7 @@
1017
<form method="post" name="frmSecurity" id="frmSecurity" class="form-action"
1118
data-onsubmit="twofa/save"
1219
data-plugin="Authenticator"
13-
data-action-route="<?php echo $route; ?>"
20+
data-action-route="<?php echo $_getvar('route'); ?>"
1421
data-hash="">
1522

1623
<table id="tblSite" class="data tblConfig round">
@@ -33,12 +40,15 @@
3340
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="2faenabled">
3441
<input type="checkbox" id="2faenabled"
3542
class="mdl-switch__input mdl-color-text--indigo-400"
36-
name="2faenabled" <?php echo $chk2FAEnabled ? 'checked' : ''; ?>/>
43+
name="2faenabled" <?php echo $_getvar('chk2FAEnabled') ? 'checked' : ''; ?>/>
3744
<span class="mdl-switch__label"><?php echo _t('authenticator', 'Activar'); ?></span>
3845
</label>
3946

4047
<div id="qr_code_wrapper">
41-
<?php if (!$chk2FAEnabled && $qrCode): ?>
48+
<?php
49+
$qrCode = $_getvar('qrCode');
50+
51+
if (!$chk2FAEnabled && $qrCode): ?>
4252
<div id="qr_code">
4353
<img id="qrcode" src="data:image/gif;base64,<?php echo $qrCode; ?>" alt="QR Code"/>
4454
</div>
@@ -69,7 +79,7 @@
6979
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
7080
<input id="expiredays" name="expiredays" type="number" step="1"
7181
min="0" max="720" class="mdl-textfield__input mdl-color-text--indigo-400"
72-
value="<?php echo $expireDays ?: 90; ?>" required/>
82+
value="<?php echo $_getvar('expireDays') ?: 90; ?>" required/>
7383
<label class="mdl-textfield__label"
7484
for="expiredays"><?php echo _t('authenticator', 'Días'); ?></label>
7585
</div>
@@ -84,7 +94,7 @@
8494
title="<?php echo _t('authenticator', 'Ver códigos'); ?>"
8595
data-onclick="twofa/viewRecoveryCodes"
8696
data-plugin="Authenticator"
87-
data-action-route="<?php echo $viewCodesRoute; ?>"
97+
data-action-route="<?php echo $_getvar('viewCodesRoute'); ?>"
8898
data-dst-id="#recovery-codes">remove_red_eye</i>
8999
</td>
90100
<td class="valField" id="recovery-codes" style="display: none;">

0 commit comments

Comments
 (0)