| 123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- error_reporting(E_ALL);
- 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,25);
- $action = substr(trim($_GET['action']),0,9);
- $stats = true;
- if (!(new token)->isAdmin($token)) {
- echo "admin access denied";
- exit;
- }
- if($stats == true) {
- (new stats)->log($ip,$action,$token);
- }
- switch($action) {
- case 'blacklist':
- if((new action)->blackList($ip)){
- echo " blacklisted " . long2ip($ip) ."\n";
- } else {
- echo " fehler\n";
- };
- break;
- case 'whitelist':
- if((new action)->whiteList($ip)){
- echo " whitelisted " . long2ip($ip) ."\n";
- } else {
- echo " fehler\n";
- };
- break;
- }
|