Browse Source

Move log out and back codes link into 2fa box for better readability

Fixes https://github.com/nextcloud/server/issues/2538

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
tags/v12.0.0beta1
Christoph Wurst 7 years ago
parent
commit
511df0ec99
No account linked to committer's email address
2 changed files with 27 additions and 21 deletions
  1. 12
    9
      core/templates/twofactorselectchallenge.php
  2. 15
    12
      core/templates/twofactorshowchallenge.php

+ 12
- 9
core/templates/twofactorselectchallenge.php View File

@@ -18,13 +18,16 @@
<?php endforeach; ?>
</ul>
</p>
<p class="two-factor-link">
<a <?php print_unescaped($_['logout_attribute']); ?>><?php p($l->t('Cancel log in')) ?></a>
<?php if (!is_null($_['backupProvider'])): ?>
<br>
<a href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.showChallenge',
[
'challengeProviderId' => $_['backupProvider']->getId(),
'redirect_url' => $_['redirect_url'],
]
)) ?>"><?php p($l->t('Use backup code')) ?></a>
<?php endif; ?>
</p>
</div>
<a class="two-factor-link" <?php print_unescaped($_['logout_attribute']); ?>><?php p($l->t('Cancel log in')) ?></a>
<?php if (!is_null($_['backupProvider'])): ?>
<a class="two-factor-link" href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.showChallenge',
[
'challengeProviderId' => $_['backupProvider']->getId(),
'redirect_url' => $_['redirect_url'],
]
)) ?>"><?php p($l->t('Use backup code')) ?></a>
<?php endif;

+ 15
- 12
core/templates/twofactorshowchallenge.php View File

@@ -12,22 +12,25 @@ $template = $_['template'];
?>

<div class="warning">
<h2 class="two-factor-header"><?php p($provider->getDisplayName()); ?></h2>
<?php if ($error): ?>
<h2 class="two-factor-header"><?php p($provider->getDisplayName()); ?></h2>
<?php if ($error): ?>
<?php if($error_message): ?>
<p><strong><?php p($error_message); ?></strong></p>
<?php else: ?>
<p><strong><?php p($l->t('Error while validating your second factor')); ?></strong></p>
<?php endif; ?>
<?php endif; ?>
<?php print_unescaped($template); ?>
<p class="two-factor-link">
<a <?php print_unescaped($_['logout_attribute']); ?>><?php p($l->t('Cancel log in')) ?></a>
<?php if (!is_null($_['backupProvider'])): ?>
<br>
<a href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.showChallenge',
[
'challengeProviderId' => $_['backupProvider']->getId(),
'redirect_url' => $_['redirect_url'],
]
)) ?>"><?php p($l->t('Use backup code')) ?></a>
<?php endif; ?>
<?php print_unescaped($template); ?>
</p>
</div>
<a class="two-factor-link" <?php print_unescaped($_['logout_attribute']); ?>><?php p($l->t('Cancel log in')) ?></a>
<?php if (!is_null($_['backupProvider'])): ?>
<a class="two-factor-link" href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.showChallenge',
[
'challengeProviderId' => $_['backupProvider']->getId(),
'redirect_url' => $_['redirect_url'],
]
)) ?>"><?php p($l->t('Use backup code')) ?></a>
<?php endif;

Loading…
Cancel
Save