| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- require_once 'action.php';
- require_once 'db.php';
- require_once 'token.php';
- require_once 'stats.php';
- $ip = ip2long(substr(trim($_GET['ip']),0,15));
- $token = substr(trim($_GET['token']),0,32);
- $action = substr(trim($_GET['action']),0,9);
- $clientIP = ip2long(substr(trim($_SERVER['REMOTE_ADDR']),0,15));
- $stats = true;
- $act = new action;
- if($act->isBlocked($clientIP)) {
- http_response_code(403);
- exit;
- }
- if (!(new token)->isReporter($token)) {
- $act->block($clientIP);
- echo "client access denied";
- exit;
- }
- if($stats == true) {
- (new stats)->log($clientIP,$ip,$action,$token);
- }
- switch($action) {
- case 'delist':
- if($act->delist($ip)){
- echo long2ip($ip) . " delisted\n";
- } else {
- echo long2ip($ip) . " not delisted\n";
- };
- break;
- default:
- if($act->list($ip)){
- echo " inserted " . long2ip($ip) ."\n";
- } else {
- echo " fehler\n";
- };
- }
|