![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mautic.corals.io/app/bundles/CoreBundle/IpLookup/ |
<?php namespace Mautic\CoreBundle\IpLookup; class ExtremeIpLookup extends AbstractRemoteDataLookup { public string $businessWebsite = ''; public string $continent = ''; public string $countryCode = ''; public string $ipName = ''; public string $ipType = ''; public string $lat = ''; public string $lon = ''; public string $org = ''; public string $query = ''; public string $status = ''; /** * Return attribution HTML displayed in the configuration UI. */ public function getAttribution(): string { return '<a href="https://extreme-ip-lookup.com/" target="_blank">extreme-ip-lookup.com</a> is a free lookup service that does not require an api key.'; } /** * Get the URL to fetch data from. */ protected function getUrl(): string { $auth = !empty($this->auth) ? '?key='.$this->auth : ''; return 'https://extreme-ip-lookup.com/json/'.$this->ip.$auth; } protected function parseResponse($response) { $data = json_decode($response, true); if ($data) { foreach ($data as $key => $value) { switch ($key) { case 'region': $key = 'region'; break; case 'country': $key = 'country'; break; case 'city': $key = 'city'; break; case 'businessName': $key = 'organization'; break; } $this->$key = $value; } } } }