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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 type="password" minlength="15" name="password" id="password" class="inputtext" required="required"
  42. maxlength="307200" pattern=".{15,307200}" placeholder="Password" autocomplete="current-password" />
  43. </td>
  44. <td>
  45. <input type="text" name="twofa" id="twofa" class="inputtext" maxlength="6" pattern="[0-9]{6}"
  46. inputmode="numeric" placeholder="2FA" size="6" title="Leave blank if you have not enabled 2FA"
  47. autocomplete="one-time-code" />
  48. </td>
  49. </tr>
  50. <tr>
  51. <td colspan="2">
  52. <input type="submit" name="login" value="Log In" class="submit" />
  53. </td>
  54. </tr>
  55. </table>
  56. </form>
  57. <?php
  58. } # if !$Banned
  59. else { ?>
  60. <p class="error">
  61. You're banned from logging in for a few hours.
  62. </p>
  63. <?php
  64. }
  65. if ($Attempts > 0) { ?>
  66. <p class="center">
  67. Forgot your password?
  68. <a href="login.php?act=recover" class="tooltip" title="Recover your password">Reset it here!</a>
  69. </p>
  70. <?php
  71. } else {
  72. echo $HTML = <<<HTML
  73. <p class="center mouseless">
  74. 1. …and graphs, scalars, vectors, patterns,
  75. <br />
  76. constraints, models, and more
  77. </p>
  78. HTML;
  79. }
  80. View::show_footer();