#use CGI::Carp 'fatalsToBrowser';
#use strict;
-use Geo::IP::PurePerl;
require '/var/ipfire/general-functions.pl';
+require "${General::swroot}/location-functions.pl";
require "${General::swroot}/lang.pl";
require "${General::swroot}/header.pl";
+# Libloc database handle.
+my $libloc_db_handle = &Location::Functions::init();
+
use POSIX();
#workaround to suppress a warning when a variable is used only once
my $lines = 0;
my @log=();
my $country = $cgiparams{country};
-my $gi = Geo::IP::PurePerl->new();
if (!$skip)
{
}
elsif($srcaddr ne '') {
# or srcaddr matches country code
- my $ccode = $gi->country_code_by_name($srcaddr);
+ my $ccode = &Location::Functions::lookup_country_code($libloc_db_handle, $srcaddr);
if($ccode eq uc($country)){
$log[$lines] = $_;
$lines++;
if($iface eq $country || $srcaddr ne '') {
my $ccode='';
if($iface ne $country) {
- $ccode = $gi->country_code_by_name($srcaddr);
+ $ccode = &Location::Functions::lookup_country_code($libloc_db_handle, $srcaddr);
}
if($iface eq $country || $ccode eq uc($country)) {
my $chain = '';