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

index 676d95f8a6daa199008df6040b3390fe7eb9ffd3..0a097e2c05ee26f00e747694fa01b8660d75dcdd 100755 (executable)
@@ -27,7 +27,7 @@ use IO::Socket;
 #use CGI::Carp 'fatalsToBrowser';
 
 require '/var/ipfire/general-functions.pl';
-require "${General::swroot}/geoip-functions.pl";
+require "${General::swroot}/location-functions.pl";
 require "${General::swroot}/ids-functions.pl";
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
@@ -269,6 +269,9 @@ my %dns_servers = ();
 # Read-in config file.
 &General::readhasharray("$servers_file", \%dns_servers);
 
+# Libloc database handle
+my $libloc_db_handle = &Location::Functions::init();
+
 &Header::openpage($Lang::tr{'dns'}, 1, '');
 
 &Header::openbigbox('100%', 'left', '', $errormessage);
@@ -594,9 +597,9 @@ END
                                        $status_colour = ${Header::colourred};
                                }
 
-                               # collect more information about name server (rDNS, GeoIP country code)
-                               my $ccode = &GeoIP::lookup($nameserver);
-                               my $flag_icon = &GeoIP::get_flag_icon($ccode);
+                               # collect more information about name server (rDNS, country code)
+                               my $ccode = &Location::Functions::lookup_country_code($libloc_db_handle, $nameserver);
+                               my $flag_icon = &Location::Functions::get_flag_icon($ccode);
 
                                my $rdns;