mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-24 18:03:06 +02:00
Multiple CGI's: Use &GeoIP::get_flag_icon for getting country flags.
This commit is contained in:
@@ -21,6 +21,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";
|
||||
|
||||
@@ -372,10 +373,15 @@ foreach $_ (@log)
|
||||
<td align='center' $col>$srcport<br/>$dstport</td>
|
||||
END
|
||||
;
|
||||
if ( $fcode ne "" ){
|
||||
print "<td align='center' $col><a href='../country.cgi#$fcode'><img src='/images/flags/$fcode.png' border='0' align='absmiddle' alt='$ccode'></a></td>";}
|
||||
else {
|
||||
print "<td align='center' $col></td>";}
|
||||
# Get flag icon for of the country.
|
||||
my $flag_icon = &GeoIP::get_flag_icon($fcode);
|
||||
|
||||
if ( $flag_icon) {
|
||||
print "<td align='center' $col><a href='../country.cgi#$fcode'><img src='$flag_icon' border='0' align='absmiddle' alt='$ccode'></a></td>";
|
||||
} else {
|
||||
print "<td align='center' $col></td>";
|
||||
}
|
||||
|
||||
print <<END
|
||||
<td align='center' $col>$macaddr</td>
|
||||
</tr>
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -460,11 +461,15 @@ for($s=0;$s<$lines;$s++)
|
||||
print "<td align='center' $col>$key[$s]</td>";
|
||||
}
|
||||
else {
|
||||
if($key[$s] ne 'unknown' ) {
|
||||
my $fcode = lc($key[$s]);
|
||||
print "<td align='center' $col><a href='/cgi-bin/country.cgi#$fcode'><img src='/images/flags/$fcode.png' border='0' align='absmiddle' alt='$key[$s]' title='$key[$s]'></a></td>";}
|
||||
else {
|
||||
print "<td align='center' $col>$key[$s]</td>";
|
||||
my $fcode = lc($key[$s]);
|
||||
|
||||
# Get flag icon for of the country.
|
||||
my $flag_icon = &GeoIP::get_flag_icon($fcode);
|
||||
|
||||
if($flag_icon) {
|
||||
print "<td align='center' $col><a href='/cgi-bin/country.cgi#$fcode'><img src='$flag_icon' border='0' align='absmiddle' alt='$key[$s]' title='$key[$s]'></a></td>";
|
||||
} else {
|
||||
print "<td align='center' $col>$key[$s]</td>";
|
||||
}
|
||||
}
|
||||
print "<td align='center' $col>$value[$s]</td>";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -441,13 +442,19 @@ for($s=0;$s<$lines;$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>";
|
||||
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' 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>";
|
||||
|
||||
# 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 ){}
|
||||
|
||||
Reference in New Issue
Block a user