Parcourir la source

Add files via upload

Daniele Bonini (皮夕): WebDev and DevOps by lots of Simplicity bits il y a 3 ans
Parent
commit
f759b71d76
2 fichiers modifiés avec 7 ajouts et 3 suppressions
  1. 5 1
      config.inc.sample
  2. 2 2
      index.php

+ 5 - 1
config.inc.sample

@@ -50,6 +50,8 @@ define('APP_USE', "PRIVATE");
 define('APP_CONTEXT', "SUPPORT");
 define('APP_WELCOME_MSG', "Welcome to 5 Mode hugs list:");
 define('APP_SUPPORT_MSG', "TIME FOR A SMALL DONATION!");
+// Max signs from a single client
+define('APP_MAX_FROM_IP', 5);
 
 define('DISPLAY_NAME_FONT', "Yuji Boku");
 define('DISPLAY_SUBMIT_BUTTON', "Submit");
@@ -80,7 +82,9 @@ $CONFIG = [
       // App use: SUPPORT or EVENT
       'CONTEXT' => "SUPPORT",
       'WELCOME_MSG' => "Welcome to our 5 Mode hugs list:",
-      'SUPPORT_MSG' => "TIME FOR A SMALL DONATION!"
+      'SUPPORT_MSG' => "TIME FOR A SMALL DONATION!",
+      // Max signs from a single client
+      'APP_MAX_FROM_IP' =>  5
       ],
     
     'DISPLAY' => [

+ 2 - 2
index.php

@@ -241,7 +241,7 @@
   }  
   
   $rescaptcha1=$captchacount>=4;
-  $rescaptcha2=count(array_filter($captchaHistory, "odd")) > 2;
+  $rescaptcha2=count(array_filter($captchaHistory, "odd")) > (APP_MAX_FROM_IP - 1);
   if ($rescaptcha1) {
     echo("WARNING: captcha expired #1<br>");
   }  
@@ -440,7 +440,7 @@
  chdir($curPath);
 
  $signHistory = file($curPath . DIRECTORY_SEPARATOR . ".ACT_history");
- $captchaHistory = []; //file($curPath . DIRECTORY_SEPARATOR . ".ACT_captchahistory");
+ $captchaHistory = file($curPath . DIRECTORY_SEPARATOR . ".ACT_captchahistory");
 
  $password = filter_input(INPUT_POST, "Password");
  if ($password==PHP_STR) {