Skip to content

Commit

Permalink
Merge pull request #1068 from itflow-org/http-header-blocked
Browse files Browse the repository at this point in the history
Show a 429 header when logins are blocked
  • Loading branch information
johnnyq authored Sep 21, 2024
2 parents f1ce116 + 19dc33a commit c5575e7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions login.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Login', log_action = 'Blocked', log_description = '$ip was blocked access to login due to IP lockout', log_ip = '$ip', log_user_agent = '$user_agent'");

// Inform user & quit processing page
header("HTTP/1.1 429 Too Many Requests");
exit("<h2>$config_app_name</h2>Your IP address has been blocked due to repeated failed login attempts. Please try again later. <br><br>This action has been logged.");
}

Expand Down

0 comments on commit c5575e7

Please sign in to comment.