twofactorshowchallenge.php 1.0 KB

12345678910111213141516171819202122232425262728
  1. <?php
  2. /** @var $l \OCP\IL10N */
  3. /** @var $_ array */
  4. /* @var $error boolean */
  5. $error = $_['error'];
  6. /* @var $provider OCP\Authentication\TwoFactorAuth\IProvider */
  7. $provider = $_['provider'];
  8. /* @var $template string */
  9. $template = $_['template'];
  10. ?>
  11. <div class="warning">
  12. <h2 class="two-factor-header"><?php p($provider->getDisplayName()); ?></h2>
  13. <?php if ($error): ?>
  14. <p><strong><?php p($l->t('Error while validating your second factor')); ?></strong></p>
  15. <?php endif; ?>
  16. <?php print_unescaped($template); ?>
  17. </div>
  18. <a class="two-factor-link" <?php print_unescaped($_['logout_attribute']); ?>><?php p($l->t('Cancel log in')) ?></a>
  19. <?php if (!is_null($_['backupProvider'])): ?>
  20. <a class="two-factor-link" href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.showChallenge',
  21. [
  22. 'challengeProviderId' => $_['backupProvider']->getId(),
  23. 'redirect_url' => $_['redirect_url'],
  24. ]
  25. )) ?>"><?php p($l->t('Use backup code')) ?></a>
  26. <?php endif;