re-enable cf block

This commit is contained in:
Kieran 2018-08-01 22:41:07 +08:00
parent 2f44dd2dde
commit a9565b88e8
2 changed files with 6 additions and 10 deletions

View File

@ -58,13 +58,11 @@
$dlCounter = $redis->get($hashKey); $dlCounter = $redis->get($hashKey);
if($dlCounter != FALSE) { if($dlCounter != FALSE) {
if($dlCounter >= _DL_CAPTCHA * 2){ if($dlCounter >= _DL_CAPTCHA * 2){
/*$cfbk = 'VC:CF:BLOCK'; $cfbk = 'VC:CF:BLOCK';
if(_CLOUDFLARE_API_KEY != 'API_KEY' && $redis->sIsMember($cfbk, _UIP) == False){ if(_CLOUDFLARE_API_KEY != 'API_KEY' && $redis->sIsMember($cfbk, _UIP) == False){
$redis->sadd($cfbk, _UIP); $redis->sadd($cfbk, _UIP);
include_once('cloudflare.php');
AddFirewallRule(_UIP); AddFirewallRule(_UIP);
}*/ }
header('location: /');
exit(); exit();
}else if($dlCounter >= _DL_CAPTCHA){ }else if($dlCounter >= _DL_CAPTCHA){
//redirect for captcha check //redirect for captcha check

View File

@ -216,7 +216,7 @@
} }
function ga_event($cat, $act) { function ga_event($cat, $act) {
GACollect(array( ga_collect(array(
"t" => "event", "t" => "event",
"ec" => $cat, "ec" => $cat,
"ea" => $act "ea" => $act
@ -331,7 +331,7 @@
'target' => 'ip', 'target' => 'ip',
'value' => $ip 'value' => $ip
), ),
'notes' => 'void.cat auto block' 'notes' => 'blocked by: ' . $_SERVER['SERVER_NAME']
); );
$ch = curl_init(); $ch = curl_init();
@ -350,11 +350,9 @@
$cfr = json_decode($result, true); $cfr = json_decode($result, true);
if($cfr['success'] == True){ if($cfr['success'] == True){
$discord_data = array("content" => "[IP BLOCKED] " . $ip); send_discord_msg(array("content" => "[IP BLOCKED] " . $ip));
include_once("discord.php");
}else { }else {
$discord_data = array("content" => "[IP BLOCK ERROR] " . $ip . "\n```json\n" . $result . "\n```"); send_discord_msg(array("content" => "[IP BLOCK ERROR] " . $ip . "\n```json\n" . $result . "\n```"));
include_once("discord.php");
} }
return $cfr; return $cfr;