twofactorshowchallenge.php 1.2 KB

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