| 1234567891011121314151617181920212223242526 |
- <?php
- error_reporting(E_ALL);
- require_once 'action.php';
- require_once 'db.php';
- require_once 'token.php';
- $clientIP = ip2long(substr(trim($_SERVER['REMOTE_ADDR']),0,15));
- $token = substr(trim($_GET['token']),0,32);
- $act= new action;
- if($act->isBlocked($clientIP)) {
- http_response_code(403);
- exit;
- }
- if ((new token)->isConsumer($token) == true) {
- $act->block($clientIP);
- echo "user access denied";
- exit;
- }
- $list = $act->getBlockList();
- foreach($list as $ip) {
- echo long2ip($ip) . PHP_EOL;
- }
|