|
1 | 1 | <?php |
2 | 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 |
| 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 | 7 | */ |
8 | 8 | ?> |
9 | 9 | <div id="actions" class="authenticator-2fa" align="center"> |
|
17 | 17 | <legend><?php echo _t('authenticator', 'Two Factor Authentication'); ?></legend> |
18 | 18 | <div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label"> |
19 | 19 | <input id="pin" name="pin" type="text" |
20 | | - pattern="([0-9]{6}|[0-9a-f]{20})" class="mdl-textfield__input mdl-color-text--indigo-400" |
| 20 | + pattern="([0-9]{6}|[0-9a-f]{20})" |
| 21 | + class="mdl-textfield__input mdl-color-text--indigo-400" |
21 | 22 | maxlength="20"/> |
22 | 23 | <label class="mdl-textfield__label" |
23 | 24 | for="pin"><?php echo _t('authenticator', 'Enter code'); ?></label> |
24 | 25 | </div> |
25 | 26 |
|
26 | | - <label class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect" for="code_reset"> |
27 | | - <input type="checkbox" name="code_reset" id="code_reset" class="mdl-checkbox__input"> |
28 | | - <span class="mdl-checkbox__label"><?php echo _t('authenticator', 'Forgot my code'); ?></span> |
29 | | - </label> |
| 27 | + <?php if ($_getvar('isMailEnabled')): ?> |
| 28 | + <label class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect" |
| 29 | + for="code_reset"> |
| 30 | + <input type="checkbox" name="code_reset" id="code_reset" |
| 31 | + class="mdl-checkbox__input"> |
| 32 | + <span class="mdl-checkbox__label"><?php echo _t('authenticator', 'Forgot my code'); ?></span> |
| 33 | + |
| 34 | + <div id="help-2fa" |
| 35 | + class="icon material-icons <?php echo $icons->getIconHelp()->getClass(); ?>"><?php echo $icons->getIconHelp()->getIcon(); ?></div> |
| 36 | + </label> |
| 37 | + |
| 38 | + |
| 39 | + <div class="mdl-tooltip mdl-tooltip--large" for="help-2fa"> |
| 40 | + <p> |
| 41 | + <?php echo _t('authenticator', 'This will send an email with a recovery code. You don\'t need to enter any code, only click on "Log In".'); ?> |
| 42 | + </p> |
| 43 | + |
| 44 | + <p> |
| 45 | + <?php echo _t('authenticator', sprintf('If there aren\'t any recovery codes left, you will need to wait %dh for new codes', $_getvar('recoveryGraceTime'))); ?> |
| 46 | + </p> |
| 47 | + </div> |
| 48 | + <?php endif; ?> |
30 | 49 |
|
31 | 50 | <?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'); ?>"/> |
| 51 | + <input type="hidden" name="from" |
| 52 | + value="<?php echo $_getvar('from'); ?>"/> |
| 53 | + <input type="hidden" name="h" |
| 54 | + value="<?php echo $_getvar('from_hash'); ?>"/> |
34 | 55 | <?php endif; ?> |
35 | 56 |
|
36 | 57 | <input type="hidden" name="sk" value=""/> |
|
46 | 67 | <?php echo _t('authenticator', 'Back'); ?> |
47 | 68 | </button> |
48 | 69 |
|
49 | | - <button id="btnLogin" class="mdl-button mdl-js-button mdl-button--raised mdl-button--primary"> |
| 70 | + <button id="btnLogin" |
| 71 | + class="mdl-button mdl-js-button mdl-button--raised mdl-button--primary"> |
50 | 72 | <?php echo _t('authenticator', 'Log in'); ?> |
51 | 73 | <i class="material-icons" |
52 | 74 | title="<?php echo _t('authenticator', 'Request'); ?>"><?php echo $icons->getIconPlay()->getIcon(); ?></i> |
|
0 commit comments