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);
if($dlCounter != FALSE) {
if($dlCounter >= _DL_CAPTCHA * 2){
/*$cfbk = 'VC:CF:BLOCK';
$cfbk = 'VC:CF:BLOCK';
if(_CLOUDFLARE_API_KEY != 'API_KEY' && $redis->sIsMember($cfbk, _UIP) == False){
$redis->sadd($cfbk, _UIP);
include_once('cloudflare.php');
AddFirewallRule(_UIP);
}*/
header('location: /');
}
exit();
}else if($dlCounter >= _DL_CAPTCHA){
//redirect for captcha check

View File

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