Oppaitime'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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <? View::show_header('Login'); ?>
  2. <span id="no-cookies" class="hidden warning">You appear to have cookies disabled.<br /><br /></span>
  3. <noscript><span class="warning"><?=SITE_NAME?> requires JavaScript to function properly. Please enable JavaScript in your browser.</span><br /><br /></noscript>
  4. <?
  5. if (strtotime($BannedUntil) < time()) {
  6. ?>
  7. <form class="auth_form" name="login" id="loginform" method="post" action="login.php">
  8. <?
  9. if (!empty($BannedUntil) && $BannedUntil != '0000-00-00 00:00:00') {
  10. $DB->query("
  11. UPDATE login_attempts
  12. SET BannedUntil = '0000-00-00 00:00:00', Attempts = '0'
  13. WHERE ID = '".db_string($AttemptID)."'");
  14. $Attempts = 0;
  15. }
  16. if (isset($Err)) {
  17. ?>
  18. <span class="warning"><?=$Err?><br /><br /></span>
  19. <? } ?>
  20. <? if ($Attempts > 0) { ?>
  21. You have <span class="info"><?=(6 - $Attempts)?></span> attempts remaining.<br /><br />
  22. <strong>WARNING:</strong> You will be banned for 6 hours after your login attempts run out!<br /><br />
  23. <? } ?>
  24. <table class="layout">
  25. <tr>
  26. <td>Username&nbsp;</td>
  27. <td colspan="2">
  28. <input type="text" name="username" id="username" class="inputtext" required="required" maxlength="20" pattern="[A-Za-z0-9_?]{1,20}" autofocus="autofocus" placeholder="Username" />
  29. </td>
  30. </tr>
  31. <tr>
  32. <td>Password&nbsp;</td>
  33. <td colspan="2">
  34. <input type="password" name="password" id="password" class="inputtext" required="required" maxlength="307200" pattern=".{6,307200}" placeholder="Password" />
  35. </td>
  36. </tr>
  37. <tr>
  38. <td></td>
  39. <td>
  40. <input type="checkbox" id="keeplogged" name="keeplogged" value="1"<?=(isset($_REQUEST['keeplogged']) && $_REQUEST['keeplogged']) ? ' checked="checked"' : ''?> />
  41. <label for="keeplogged">Remember me</label>
  42. </td>
  43. <td><input type="submit" name="login" value="Log in" class="submit" /></td>
  44. </tr>
  45. </table>
  46. </form>
  47. <?
  48. } else {
  49. ?>
  50. <span class="warning">You are banned from logging in for another <?=time_diff($BannedUntil)?>.</span>
  51. <?
  52. }
  53. if ($Attempts > 0) {
  54. ?>
  55. <br /><br />
  56. Forgot your password? <a href="login.php?act=recover" class="tooltip" title="Recover your password" style="text-decoration: underline;">Reset it here!</a>
  57. <?
  58. }
  59. ?>
  60. <script type="text/javascript">
  61. cookie.set('cookie_test', 1, 1);
  62. if (cookie.get('cookie_test') != null) {
  63. cookie.del('cookie_test');
  64. } else {
  65. $('#no-cookies').gshow();
  66. }
  67. </script>
  68. <? View::show_footer(); ?>