]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/logs.cgi/firewalllogip.dat
Merge remote-tracking branch 'mfischer/python' into next
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / logs.cgi / firewalllogip.dat
index e4e845198be965c6399e246d45aaa5124d5a1e81..7d82d20e725e07f3569921a51ef030650b5e2510 100644 (file)
@@ -19,6 +19,7 @@ use Getopt::Std;
 #use CGI::Carp 'fatalsToBrowser';
 
 require '/var/ipfire/general-functions.pl';
+require "${General::swroot}/geoip-functions.pl";
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
 
@@ -397,9 +398,9 @@ if ($showpie != 2 && $pienumber <= 50 && $pienumber != 0) {
         print FILE $myimage->png;
         close(FILE);
         #####################################################
-        print "<table align='center'><tr><td>";
+        print "<div style='text-align:center'>";
         print "<img src='/graphs/fwlog-ip$imagerandom.png'>";
-        print "</td></tr></table>";
+        print "</div>";
 }
 
 print <<END
@@ -408,7 +409,7 @@ print <<END
 <th width='10%' align='center' class='boldbase'></th>
 <th width='30%' align='center' class='boldbase'><b>$Lang::tr{'ip address'}</b></th>
 <th width='10%' align='center' class='boldbase'><b>$Lang::tr{'country'}</b></th>
-<th width='10%' align='center' class='boldbase'><b>Count</b></th>
+<th width='10%' align='center' class='boldbase'><b>$Lang::tr{'count'}</b></th>
 <th width='30%' align='center' class='boldbase'><b>$Lang::tr{'percentage'}</b></th>
 </tr>
 END
@@ -439,15 +440,21 @@ for($s=0;$s<$lines;$s++)
   my $fcode = lc($ccode);
   
   $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='details'></form></td>";
+  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>";
   print "<td align='center' $col><a href='/cgi-bin/ipinfo.cgi?ip=$key[$s]'>$key[$s]</a></td>";
-  if ( $fcode ne "" ){
-    print "<td align='center' $col><a href='/cgi-bin/country.cgi#$fcode'><img src='/images/flags/$fcode.png' border='0' align='absmiddle' alt='$ccode'></a></td>";}
-  else {
-    print "<td align='center' $col></td>";}
-    print "<td align='center' $col>$value[$s]</td>";
-    print "<td align='center' $col>$percent</td>";
-    print "</tr>";
+
+  # Get flag icon for of the country.
+  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>";
+  } else {
+       print "<td align='center' $col></td>";
+  }
+
+  print "<td align='center' $col>$value[$s]</td>";
+  print "<td align='center' $col>$percent</td>";
+  print "</tr>";
   }
 
 if($cgiparams{'otherspie'} == 2 ){}