BioTorrents.de’s version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

login.php 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <?php
  2. declare(strict_types=1);
  3. $ENV = ENV::go();
  4. $Twig = Twig::go();
  5. View::show_header('Login'); ?>
  6. <p class="center mouseless">
  7. A platform to share <strong>biological sequence</strong><br />
  8. and <strong>medical imaging</strong> data<?= ($Attempts > 0) ? '' : '<sup>1</sup>' ?>
  9. </p>
  10. <p id="no-cookies" class="hidden error">You appear to have cookies disabled.</p>
  11. <?php
  12. if (!$Banned) { ?>
  13. <form class="auth_form" name="login" id="loginform" method="post" action="login.php">
  14. <?php
  15. if (isset($Err)) { ?>
  16. <p class="error">
  17. <?= $Err ?>
  18. </p>
  19. <?php } ?>
  20. <?php
  21. if ($Attempts > 0) { ?>
  22. <aside class="notice">
  23. <p>
  24. You have
  25. <span class="info"><?= (6 - $Attempts) ?></span>
  26. attempts remaining.
  27. </p>
  28. <p>
  29. <strong>You'll be banned for 6 hours after your login attempts run out!</strong>
  30. </p>
  31. </aside>
  32. <?php } ?>
  33. <table>
  34. <tr>
  35. <td colspan="2">
  36. <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" name="username"
  37. id="username" class="inputtext" required="required" maxlength="20" pattern="[A-Za-z0-9_?]{1,20}"
  38. autofocus="autofocus" placeholder="Username" size="40" autocomplete="username" />
  39. </td>
  40. </tr>
  41. <tr>
  42. <td>
  43. <?=
  44. $Twig->render('input/passphrase.html', [
  45. 'name' => 'password',
  46. 'id' => 'password',
  47. 'placeholder' => 'Passphrase',
  48. 'pw_min' => $ENV->PW_MIN,
  49. 'pw_max' => $ENV->PW_MAX,
  50. 'advice' => false,
  51. ]) ?>
  52. </td>
  53. <td>
  54. <input type="text" name="twofa" id="twofa" class="inputtext" maxlength="6" pattern="[0-9]{6}"
  55. inputmode="numeric" placeholder="2FA" size="6" title="Leave blank if you have not enabled 2FA"
  56. autocomplete="one-time-code" />
  57. </td>
  58. </tr>
  59. <tr>
  60. <td colspan="2">
  61. <input type="submit" name="login" value="Log In" class="submit" />
  62. </td>
  63. </tr>
  64. </table>
  65. </form>
  66. <?php
  67. } # if !$Banned
  68. else { ?>
  69. <p class="error">
  70. You're banned from logging in for a few hours.
  71. </p>
  72. <?php
  73. }
  74. if ($Attempts > 0) { ?>
  75. <p class="center">
  76. Forgot your passphrase?
  77. <a href="login.php?act=recover" class="tooltip" title="Recover your passphrase">Reset it here!</a>
  78. </p>
  79. <?php
  80. } else {
  81. echo $HTML = <<<HTML
  82. <p class="center mouseless">
  83. 1. …and graphs, scalars, vectors, patterns,
  84. <br />
  85. constraints, models, and more
  86. </p>
  87. HTML;
  88. }
  89. View::show_footer();