Hi,
Working on some 'cosmetics', I would suggest to add a few "align="center=" (Looks somehow better - please see below):
On 08.09.2017 19:58, Peter Müller wrote:
Show rDNS/PTR entry and country flag of the used nameservers on the nameserver status list at "netexternal.cgi".
These information might be useful for debugging, or are just "nice to have" and do not harm anything. :-)
Changes since v1: Corrected file link to country.cgi and added title to flag. Please disregard the first version of this patch.
Signed-off-by: Peter Müller peter.mueller@link38.eu
diff --git a/html/cgi-bin/netexternal.cgi b/html/cgi-bin/netexternal.cgi index 299612d4c..6fe0cc7d6 100644 --- a/html/cgi-bin/netexternal.cgi +++ b/html/cgi-bin/netexternal.cgi @@ -25,9 +25,13 @@ use strict; #use warnings; #use CGI::Carp 'fatalsToBrowser';
+use IO::Socket; +use Geo::IP::PurePerl;
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 +103,12 @@ if ( $querry[0] ne~ ""){ <strong>$Lang::tr{'nameserver'}</strong> </th> <th align="center">
<strong>$Lang::tr{'flag'}</strong>
</th>
<th align="center">
<strong>$Lang::tr{'rdns'}</strong>
</th>
<th align="center"> <strong>$Lang::tr{'status'}</strong> </th> </tr>
@@ -139,9 +149,22 @@ END
my $table_colour = ($id++ % 2) ? $color{'color22'} : $color{'color20'};
# Get rDNS entry for nameserver (might be useful)
my $iaddr = inet_aton($nameserver);
my $rdns = gethostbyaddr($iaddr, AF_INET);
if (!$rdns) { $rdns = $Lang::tr{'lookup failed'}; }
# Get country flag for the nameserver (might be useful)
my $gi = Geo::IP::PurePerl->new();
my $ccode = $gi->country_code_by_name($nameserver);
my $fcode = lc($ccode);
my $flag_icon = &GeoIP::get_flag_icon($fcode);
- print <<END; <tr bgcolor="$table_colour"> <td>$nameserver</td>
Changed to: <td align="center">$nameserver</td>
<td align="center"><a href="country.cgi#$fcode"><img src="$flag_icon" border="0" align="absmiddle" alt="$ccode" title="$ccode"></a></td>
<td>$rdns</td>
Changed to: <td align="center">$rdns</td>
<td bgcolor="$bgcolour" align="center"> <font color="$colour"><strong>$message</strong></font> </td>
...
...
Jm2C! ;-)
Best, Matthias