Explorar o código

add protection

andre %!s(int64=4) %!d(string=hai) anos
pai
achega
e377eefeaa
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      admin.php

+ 3 - 2
admin.php

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