Exemplo n.º 1
0
 public static function isAllowedIP()
 {
     $allowed = false;
     $allowed_ip_addresses = Context::config('allowed_ip_addresses');
     if ($allowed_ip_addresses && !empty($allowed_ip_addresses)) {
         $allowed = in_array("*", $allowed_ip_addresses) || in_array(Request::ip(), $allowed_ip_addresses);
     }
     return $allowed;
 }
Exemplo n.º 2
0
 public function ip()
 {
     $ip = Request::ip();
     return json_decode(file_get_contents("http://ipinfo.io/{$ip}/json"), true);
 }