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; }
public function ip() { $ip = Request::ip(); return json_decode(file_get_contents("http://ipinfo.io/{$ip}/json"), true); }