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.twig 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. {% from 'macro/form.twig' import checked %}
  2. <span id="no-cookies" class="hidden warning-login">You appear to have cookies disabled.<br /><br /></span>
  3. <noscript><span class="warning-login">{{ constant('SITE_NAME') }} requires JavaScript to function properly.
  4. Please enable JavaScript in your browser.</span><br /><br /></noscript>
  5. <div id="logo">
  6. <a href="/" style="margin-left: 0;"><img src="{{
  7. constant('STATIC_SERVER') }}/styles/public/images/loginlogo.png" alt="{{
  8. constant('SITE_NAME') }}" title="{{ constant('SITE_NAME') }}" /></a>
  9. </div>
  10. <div class="main">
  11. <div class="auth">
  12. {% if error or delta > 0 or watch.nrAttempts > 0 %}
  13. <div class="warning-login">
  14. {% if error %}
  15. {% if error == constant('\\Gazelle\\Login::ERR_USERNAME') %}
  16. You must supply a valid username.
  17. {% elseif error == constant('\\Gazelle\\Login::ERR_PASSWORD') %}
  18. You must supply a valid password.
  19. {% elseif error == constant('\\Gazelle\\Login::ERR_CREDENTIALS') %}
  20. Your login credentials were not recognized.<br />
  21. Please double check your username and password.<br />
  22. If previously enabled, you must supply a valid two-factor authentication code.<br />
  23. {% elseif error == constant('\\Gazelle\\Login::ERR_UNCONFIRMED') %}
  24. Your account has not been confirmed. Please check your email account for a message with a validation link.
  25. {% else %}
  26. System error code: {{ error }}
  27. {% endif %}
  28. {% endif %}
  29. {% if delta > 0 %}
  30. <br />As a security measure, you are temporarily prevented<br />from logging in for
  31. {% if delta < 60 %}
  32. <span title="{{ delta }} seconds">a few moments.</span>
  33. {% else %}
  34. another {{ watch.bannedUntil|time_diff }}.
  35. {% endif %}
  36. <br />
  37. {% endif %}
  38. {% if watch.nrAttempts > 0 %}
  39. <br /><strong>WARNING:</strong> Incorrect login credentials will increase<br />
  40. the duration you are prevented from logging in.
  41. {% endif %}
  42. </div>
  43. {% endif %}
  44. {% if delta <= 0 %}
  45. <form class="auth_form" name="login" id="loginform" method="post" action="login.php" autocomplete="off">
  46. <div>
  47. <label for="username">Username</label>
  48. <input type="text" name="username" id="username" class="inputtext" required="required" maxlength="20" pattern="[A-Za-z0-9_?\.]{1,20}" autofocus="autofocus" placeholder="Username" />
  49. </div>
  50. <div>
  51. <label for="password">Password</label>
  52. <input type="password" name="password" id="password" class="inputtext" required="required" pattern=".{6,}" placeholder="Password" />
  53. </div>
  54. <div>
  55. <label title="2FA key (or recovery key), if configured" for="keeplogged">2FA Key</label>
  56. <input type="text" name="twofa" id="twofa" class="inputtext" placeholder="2FA key (or recovery code) if required" />
  57. </div>
  58. <div>
  59. <label title="Keep me logged in for 90 days" for="keeplogged">Remember me</label>
  60. <input title="Keep me logged in for 90 days" type="checkbox" id="keeplogged" name="keeplogged" value="1"{{ checked(keep_logged) }} />
  61. </div>
  62. <div>
  63. <input type="submit" name="login" value="Log in" class="submit" />
  64. </div>
  65. <a href="login.php?action=recover" class="tooltip" title="I forgot my password :-(">Password recovery</a>
  66. </form>
  67. {% endif %}
  68. </div>
  69. </div>
  70. <script type="text/javascript">
  71. cookie.set('cookie_test', 1, 1);
  72. if (cookie.get('cookie_test') != null) {
  73. cookie.del('cookie_test');
  74. } else {
  75. $('#no-cookies').gshow();
  76. }
  77. window.onload = function() {document.getElementById("username").focus();};
  78. </script>