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

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