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.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. <br />
  34. <table class="login_form">
  35. <tr>
  36. <td colspan="2">
  37. <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" name="username"
  38. id="username" class="inputtext" required="required" maxlength="20" pattern="[A-Za-z0-9_?]{1,20}"
  39. autofocus="autofocus" placeholder="Username" size="35" autocomplete="username" />
  40. </td>
  41. </tr>
  42. <tr>
  43. <td>
  44. <?=
  45. $Twig->render('input/passphrase.html', [
  46. 'name' => 'password',
  47. 'id' => 'password',
  48. 'placeholder' => 'Passphrase',
  49. 'pw_min' => $ENV->PW_MIN,
  50. 'pw_max' => $ENV->PW_MAX,
  51. 'advice' => false,
  52. ]) ?>
  53. </td>
  54. <td>
  55. <input type="text" name="twofa" id="twofa" class="inputtext" maxlength="6" pattern="[0-9]{6}"
  56. inputmode="numeric" placeholder="2FA" size="6" title="Leave blank if you have not enabled 2FA"
  57. autocomplete="one-time-code" />
  58. </td>
  59. </tr>
  60. <tr>
  61. <td colspan="4">
  62. <input type="submit" name="login" value="Log In" class="submit button-primary" />
  63. <?php if ($ENV->OPEN_REGISTRATION) { ?>
  64. &ensp;
  65. <a href="/register.php" class="button">Register</a>
  66. <?php } ?>
  67. </td>
  68. </tr>
  69. </table>
  70. </form>
  71. <?php
  72. } # if !$Banned
  73. else { ?>
  74. <p class="error">
  75. You're banned from logging in for a few hours.
  76. </p>
  77. <?php
  78. }
  79. if ($Attempts > 0) { ?>
  80. <p class="center">
  81. Forgot your passphrase?
  82. <a href="login.php?act=recover" class="tooltip" title="Recover your passphrase">Reset it here!</a>
  83. </p>
  84. <?php
  85. } else {
  86. echo $HTML = <<<HTML
  87. <p class="center mouseless">
  88. 1. …and graphs, scalars, vectors, patterns,
  89. <br />
  90. constraints, models, and more
  91. </p>
  92. HTML;
  93. }
  94. View::show_footer();