]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
ipinfo.cgi: Use location-functions.pl
authorStefan Schantl <stefan.schantl@ipfire.org>
Fri, 12 Jun 2020 16:02:51 +0000 (18:02 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Fri, 12 Jun 2020 16:02:51 +0000 (18:02 +0200)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
html/cgi-bin/ipinfo.cgi

index abe8a0b91b4b6f40d167a3f057b5514a1f13c4ef..0bbb96330a5405b77293c9b829c497fa8aea9aa8 100644 (file)
@@ -30,7 +30,7 @@ use strict;
 require '/var/ipfire/general-functions.pl';
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
-require "${General::swroot}/geoip-functions.pl";
+require "${General::swroot}/location-functions.pl";
 
 my %cgiparams=();
 
@@ -61,12 +61,12 @@ if (&General::validip($addr)) {
        my $hostname = gethostbyaddr($iaddr, AF_INET);
        if (!$hostname) { $hostname = $Lang::tr{'lookup failed'}; }
 
-       # enumerate GeoIP information for IP address...
-       my $db_handle = &GeoIP::init();
-       my $ccode = &GeoIP::lookup_country_code($db_handle, $addr);
+       # enumerate location information for IP address...
+       my $db_handle = &Location::Functions::init();
+       my $ccode = &Location::Functions::lookup_country_code($db_handle, $addr);
 
        # Try to get the continent of the country code.
-       my $continent = &GeoIP::get_continent_code($db_handle, $ccode);
+       my $continent = &Location::Functions::get_continent_code($db_handle, $ccode);
 
        # Check if a whois server for the continent is known.
        if($whois_servers_by_continent{$continent}) {
@@ -74,7 +74,7 @@ if (&General::validip($addr)) {
                $whois_server = $whois_servers_by_continent{$continent};
        }
 
-       my $flag_icon = &GeoIP::get_flag_icon($ccode);
+       my $flag_icon = &Location::Functions::get_flag_icon($ccode);
 
        my $sock = new IO::Socket::INET ( PeerAddr => $whois_server, PeerPort => 43, Proto => 'tcp');
        if ($sock)