reset2fa.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <div class="login">
  2. <a href="/" class="u-block u-mb40">
  3. <img src="/images/logo.svg" alt="<?= tohtml($_SESSION["APP_NAME"]) ?>" width="100" height="120">
  4. </a>
  5. <?php if ($success) { ?>
  6. <div>
  7. <h1 class="login-title">
  8. <?= tohtml( _("Account Unlocked")) ?>
  9. </h1>
  10. <div class="u-mt20">
  11. <p><?_("Two-factor authentication is now turned off for your account.<br><br>You may now proceed to log in.");?></p>
  12. <a href="/login/" class="button button-secondary">
  13. <?= tohtml( _("Log in")) ?>
  14. </a>
  15. </div>
  16. </div>
  17. <?php } else { ?>
  18. <form method="post" action="/reset2fa/">
  19. <input type="hidden" name="token" value="<?= tohtml($_SESSION["token"]) ?>">
  20. <h1 class="login-title">
  21. <?= tohtml( _("Unlock Account")) ?>
  22. </h1>
  23. <?php if (!empty($error)) { ?>
  24. <p class="error"><?= tohtml($error) ?></p>
  25. <?php } ?>
  26. <div class="u-mb10">
  27. <label for="user" class="form-label"><?= tohtml( _("Username")) ?></label>
  28. <input type="text" class="form-control" name="user" id="user" autocomplete="username" required autofocus>
  29. </div>
  30. <div class="u-mb20">
  31. <label for="twofa" class="form-label"><?= tohtml( _("2FA Reset Code")) ?></label>
  32. <input type="text" class="form-control" name="twofa" id="twofa" autocomplete="off" required>
  33. </div>
  34. <div class="u-side-by-side">
  35. <button type="submit" class="button">
  36. <?= tohtml( _("Submit")) ?>
  37. </button>
  38. <a href="/login/?logout" class="button button-secondary">
  39. <?= tohtml( _("Back")) ?>
  40. </a>
  41. </div>
  42. </form>
  43. <?php } ?>
  44. </div>