andre 4 лет назад
Родитель
Сommit
e377eefeaa
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      admin.php

+ 3 - 2
admin.php

@@ -35,16 +35,17 @@ if(isset($_GET['role'])) {
 if(isset($_GET['description'])) {
 if(isset($_GET['description'])) {
     $description = substr(trim($_GET['description']),0,40);
     $description = substr(trim($_GET['description']),0,40);
 }
 }
+$clientIP = substr(trim($_SERVER['REMOTE_ADDR']),0,15);
 $stats = true;
 $stats = true;
 
 
 $tok = new token;
 $tok = new token;
 $act = new action;
 $act = new action;
 
 
-if($act->isBlocked(ip2long(substr(trim($_SERVER['REMOTE_ADDR']),0,15)))) {
+if($act->isBlocked(ip2long($clientIP))) {
     http_response_code(403);
     http_response_code(403);
     exit;
     exit;
 }
 }
-print_r($_SERVER['REMOTE_ADDR']);
+
 if (!$tok->isAdmin($token)) {
 if (!$tok->isAdmin($token)) {
     echo "admin access denied</div></body></html>";
     echo "admin access denied</div></body></html>";
     exit;
     exit;