twofactorselectchallenge.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. $noProviders = empty($_['providers']);
  3. ?>
  4. <div class="body-login-container update">
  5. <h2 class="two-factor-header"><?php p($l->t('Two-factor authentication')) ?></h2>
  6. <?php if (!$noProviders): ?>
  7. <p><?php p($l->t('Enhanced security is enabled for your account. Choose a second factor for authentication:')) ?></p>
  8. <?php endif ?>
  9. <?php if ($_['providerMissing']): ?>
  10. <p>
  11. <strong><?php p($l->t('Could not load at least one of your enabled two-factor auth methods. Please contact your admin.')) ?></strong>
  12. </p>
  13. <?php endif; ?>
  14. <?php if ($noProviders): ?>
  15. <img class="two-factor-icon" src="<?php p(image_path('core', 'actions/password-white.svg')) ?>" alt="" />
  16. <p>
  17. <?php if (is_null($_['backupProvider'])): ?>
  18. <strong><?php p($l->t('Two-factor authentication is enforced but has not been configured on your account. Contact your admin for assistance.')) ?></strong>
  19. <?php else: ?>
  20. <strong><?php p($l->t('Two-factor authentication is enforced but has not been configured on your account. Use one of your backup codes to log in or contact your admin for assistance.')) ?></strong>
  21. <?php endif; ?>
  22. </p>
  23. <?php else: ?>
  24. <ul>
  25. <?php foreach ($_['providers'] as $provider): ?>
  26. <li>
  27. <a class="two-factor-provider"
  28. href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.showChallenge',
  29. [
  30. 'challengeProviderId' => $provider->getId(),
  31. 'redirect_url' => $_['redirect_url'],
  32. ]
  33. )) ?>">
  34. <?php
  35. if ($provider instanceof \OCP\Authentication\TwoFactorAuth\IProvidesIcons) {
  36. $icon = $provider->getLightIcon();
  37. } else {
  38. $icon = image_path('core', 'actions/password-white.svg');
  39. }
  40. ?>
  41. <img src="<?php p($icon) ?>" alt="" />
  42. <div>
  43. <h3><?php p($provider->getDisplayName()) ?></h3>
  44. <p><?php p($provider->getDescription()) ?></p>
  45. </div>
  46. </a>
  47. </li>
  48. <?php endforeach; ?>
  49. </ul>
  50. <?php endif ?>
  51. <?php if (!is_null($_['backupProvider'])): ?>
  52. <p>
  53. <a class="<?php if($noProviders): ?>button primary two-factor-primary<?php else: ?>two-factor-secondary<?php endif ?>" href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.showChallenge',
  54. [
  55. 'challengeProviderId' => $_['backupProvider']->getId(),
  56. 'redirect_url' => $_['redirect_url'],
  57. ]
  58. )) ?>">
  59. <?php p($l->t('Use backup code')) ?>
  60. </a>
  61. </p>
  62. <?php endif; ?>
  63. <p><a class="two-factor-secondary" href="<?php print_unescaped($_['logout_url']); ?>">
  64. <?php p($l->t('Cancel log in')) ?>
  65. </a></p>
  66. </div>