1
0
forked from HPR/hpr_hub

A series of changes to automate the checking of comments - resulting in a returned json file and standard responses for different actions

This commit is contained in:
2023-12-23 19:06:00 +01:00
parent 92902ffe47
commit 6b84bd01e6
4 changed files with 208 additions and 71 deletions

View File

@@ -13,4 +13,10 @@ $mailerPassword = 'THE_SMTP_MAIL_PASSWORD_HERE';
$hubBaseurl = "https://hub.hackerpublicradio.org/";
$baseurl = "https://hackerpublicradio.org/";
$naughtyfile = '/path/to/naughty.txt';
$naughty_stings_file = '/path/to/strings.txt';
$justification_file = '/path/to/justification.txt';
# Read more: http://vidiame.com/php/how-to-block-multiple-ip-addresses-using-php
?>

View File

@@ -287,8 +287,6 @@ function getUserIP()
}
return $ip . "\t" . $_SERVER['REQUEST_URI'] . "\t" . $_SERVER["HTTP_USER_AGENT"] . "\n";
}
$naughtyfile = '/home/hpr/logs/naughty-ip.txt';
# Read more: http://vidiame.com/php/how-to-block-multiple-ip-addresses-using-php
if ( strlen($_SERVER['QUERY_STRING']) > 15 ) {
file_put_contents($naughtyfile, getUserIP(), FILE_APPEND | LOCK_EX );