Hi,
Tested.
Works.
Thanks! ;-)
One suggestion:
If you change line ~156 in 'netexternal.cgi' from:
... <td>$nameserver</td> ...
to
... <td align="center">$nameserver</td> ...
it looks even better... (see Attachment)
Jm2C!
Best, Matthias
On 01.01.2016 18:11, IT Superhack wrote:
Add the GeoIP location flag to the nameservers entry on netexternal.cgi. The appropriate flag is shown between ip address and dnssec status.
Signed-off-by: Timmothy Wilson itsuperhack@web.de
diff --git a/html/cgi-bin/netexternal.cgi b/html/cgi-bin/netexternal.cgi index 299612d..757785e 100644 --- a/html/cgi-bin/netexternal.cgi +++ b/html/cgi-bin/netexternal.cgi @@ -19,6 +19,7 @@ # # ###############################################################################
+use Geo::IP::PurePerl; use strict;
# enable only the following on debugging purpose @@ -28,6 +29,7 @@ use strict; require '/var/ipfire/general-functions.pl'; require "${General::swroot}/lang.pl"; require "${General::swroot}/header.pl"; +require "${General::swroot}/geoip-functions.pl"; require "${General::swroot}/graphs.pl";
my %color = (); @@ -99,6 +101,9 @@ if ( $querry[0] ne~ ""){ <strong>$Lang::tr{'nameserver'}</strong> </th> <th align="center">
<strong>$Lang::tr{'location'}</strong>
</th>
<th align="center"> <strong>$Lang::tr{'status'}</strong> </th> </tr>
@@ -138,10 +143,20 @@ END }
my $table_colour = ($id++ % 2) ? $color{'color22'} : $color{'color20'};
# geoip lookup
my $geoaddr = Geo::IP::PurePerl->new();
my $ccode = $geoaddr->country_code_by_name($nameserver);
my $fcode = lc($ccode);
# Get flag icon for of the country.
my $flag_icon = &GeoIP::get_flag_icon($ccode);
print <<END; <tr bgcolor="$table_colour"> <td>$nameserver</td>
<td align="center">
<a href='/cgi-bin/country.cgi#$fcode'><img src='$flag_icon' border='0' align='absmiddle' alt='$ccode' title='$ccode'></a>
</td> <td bgcolor="$bgcolour" align="center"> <font color="$colour"><strong>$message</strong></font> </td>
diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl index 2bca854..836d12f 100644 --- a/langs/de/cgi-bin/de.pl +++ b/langs/de/cgi-bin/de.pl @@ -1429,6 +1429,7 @@ 'local vpn hostname/ip' => 'Lokaler VPN Hostname/IP', 'localkey' => 'Localkey', 'localkeyfile' => 'Localkeyfile', +'location' => 'Standort', 'log' => 'Protokoll', 'log enabled' => 'Log aktiviert', 'log level' => 'Log Level', diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 4c52392..51a6241 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -1459,6 +1459,7 @@ 'local vpn hostname/ip' => 'Local VPN Hostname/IP', 'localkey' => 'Localkey', 'localkeyfile' => 'Localkeyfile', +'location' => 'Location', 'log' => 'Log', 'log enabled' => 'Log Enabled', 'log level' => 'Log Level',