]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - html/cgi-bin/logs.cgi/firewalllogip.dat
GeoIP: Add lookup function for convenience
[ipfire-2.x.git] / html / cgi-bin / logs.cgi / firewalllogip.dat
index 08ef1c4be1425246971658939cb9c73171b63d45..c73d24fd663fee6af86ff0cc31e669f7acf217b0 100644 (file)
@@ -11,7 +11,6 @@
 #                          and Michael Tremer (www.ipfire.org)
 
 use strict;
-use Geo::IP::PurePerl;
 use Getopt::Std;
 
 # enable only the following on debugging purpose
@@ -212,7 +211,7 @@ if ($multifile) {
 my $MODNAME="fwlogs";
 
 &Header::showhttpheaders();
-&Header::openpage($Lang::tr{'firewall log'}, 1, '');
+&Header::openpage($Lang::tr{'firewall log ip'}, 1, '');
 &Header::openbigbox('100%', 'left', '', $errormessage);
 
 
@@ -283,7 +282,7 @@ END
 
 &Header::closebox();
 
-&Header::openbox('100%', 'left', 'Firewall Logs');
+&Header::openbox('100%', 'left', $Lang::tr{'firewall graph ip'});
 print "<p><b>$Lang::tr{'firewall hits'} $longmonthstr $daystr: $lines</b></p>";
 
 my $linesjc = 0;
@@ -436,9 +435,7 @@ for($s=0;$s<$lines;$s++)
        $col="bgcolor='$color{\"color$colorIndex\"}'";
        print "<tr>";
 
-       my $gi = Geo::IP::PurePerl->new();
-       my $ccode = $gi->country_code_by_name($key[$s]);
-       my $fcode = lc($ccode);
+       my $ccode = &GeoIP::lookup($key[$s]);
   
        $color++;
        print "<td align='center' $col><form method='post' action='showrequestfromip.dat'><input type='hidden' name='MONTH' value='$cgiparams{'MONTH'}'> <input type='hidden' name='DAY' value='$cgiparams{'DAY'}'> <input type='hidden' name='ip' value='$key[$s]'> <input type='submit' value='$Lang::tr{'details'}'></form></td>";
@@ -448,7 +445,7 @@ for($s=0;$s<$lines;$s++)
        my $flag_icon = &GeoIP::get_flag_icon($ccode);
 
        if ( $flag_icon ) {
-               print "<td align='center' $col><a href='/cgi-bin/country.cgi#$fcode'><img src='$flag_icon' border='0' align='absmiddle' alt='$ccode' title='$ccode'></a></td>";
+               print "<td align='center' $col><a href='/cgi-bin/country.cgi#$ccode'><img src='$flag_icon' border='0' align='absmiddle' alt='$ccode' title='$ccode'></a></td>";
        } else {
                print "<td align='center' $col></td>";
        }