fix request count not resetting, added request graph, im so tired

This commit is contained in:
2026-09-05 19:02:06 -04:00
parent 90232152e9
commit be3abbef16
17 changed files with 526 additions and 17 deletions
+3 -6
View File
@@ -7,7 +7,6 @@ class bot_protection{
// check if we want captcha
if(config::BOT_PROTECTION !== 1){
apcu_inc("real_requests");
if($output === true){
$frontend->loadheader(
$get,
@@ -32,7 +31,7 @@ class bot_protection{
// does key exist
apcu_exists($_COOKIE["pass"])
){
// exists, increment counter
$inc = apcu_inc($_COOKIE["pass"]);
@@ -46,8 +45,6 @@ class bot_protection{
}else{
// the cookie is OK! dont die() and give results
apcu_inc("real_requests");
if($output === true){
$frontend->loadheader(
$get,
@@ -164,8 +161,7 @@ class bot_protection{
$key = "k" . $inc . "." . $this->randomchars();
apcu_inc($key, 1, $stupid, 86400);
apcu_inc("real_requests");
apcu_dec(intdiv(time(), 3600) . ".bot_requests", 1, $s, 262800);
setcookie(
"pass",
@@ -190,6 +186,7 @@ class bot_protection{
}
}
apcu_inc(intdiv(time(), 3600) . ".bot_requests", 1, $s, 259200);
$key = "c" . apcu_inc("captcha_gen", 1) . "." . $this->randomchars();
$payload = [