list.php 519 B

1234567891011121314151617181920212223242526
  1. <?php
  2. error_reporting(E_ALL);
  3. require_once 'action.php';
  4. require_once 'db.php';
  5. require_once 'token.php';
  6. $clientIP = ip2long(substr(trim($_SERVER['REMOTE_ADDR']),0,15));
  7. $token = substr(trim($_GET['token']),0,32);
  8. $act= new action;
  9. if($act->isBlocked($clientIP)) {
  10. http_response_code(403);
  11. exit;
  12. }
  13. if ((new token)->isConsumer($token) == true) {
  14. $act->block($clientIP);
  15. echo "user access denied";
  16. exit;
  17. }
  18. $list = $act->getBlockList();
  19. foreach($list as $ip) {
  20. echo long2ip($ip) . PHP_EOL;
  21. }