twofactorshowchallenge.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /** @var \OCP\IL10N $l */
  3. /** @var array $_*/
  4. /** @var boolean $error */
  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="body-login-container update two-factor">
  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. <?php if (!is_null($_['backupProvider'])): ?>
  24. <p>
  25. <a class="two-factor-secondary" href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.showChallenge',
  26. [
  27. 'challengeProviderId' => $_['backupProvider']->getId(),
  28. 'redirect_url' => $_['redirect_url'],
  29. ]
  30. )) ?>">
  31. <?php p($l->t('Use backup code')) ?>
  32. </a>
  33. </p>
  34. <?php endif; ?>
  35. <p><a class="two-factor-secondary" href="<?php print_unescaped($_['logout_url']); ?>">
  36. <?php p($l->t('Cancel login')) ?>
  37. </a></p>
  38. </div>