From mboxrd@z Thu Jan 1 00:00:00 1970 From: IT Superhack To: development@lists.ipfire.org Subject: [PATCH] Add GeoIP location to nameservers Date: Fri, 01 Jan 2016 18:11:42 +0100 Message-ID: <5686B34E.7010602@web.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2999034470204918387==" List-Id: --===============2999034470204918387== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 --- 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 @@ # = # ############################################################################= ### =20 +use Geo::IP::PurePerl; use strict; =20 # 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"; =20 my %color =3D (); @@ -99,6 +101,9 @@ if ( $querry[0] ne~ ""){ $Lang::tr{'nameserver'} + $Lang::tr{'location'} + + $Lang::tr{'status'} @@ -138,10 +143,20 @@ END } =20 my $table_colour =3D ($id++ % 2) ? $color{'color22'} : $color{'color20'}; + =09 + # geoip lookup + my $geoaddr =3D Geo::IP::PurePerl->new(); + my $ccode =3D $geoaddr->country_code_by_name($nameserver); + my $fcode =3D lc($ccode); + # Get flag icon for of the country. + my $flag_icon =3D &GeoIP::get_flag_icon($ccode); =20 print < $nameserver + + 3D'$ccode' + $message 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' =3D> 'Lokaler VPN Hostname/IP', 'localkey' =3D> 'Localkey', 'localkeyfile' =3D> 'Localkeyfile', +'location' =3D> 'Standort', 'log' =3D> 'Protokoll', 'log enabled' =3D> 'Log aktiviert', 'log level' =3D> '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' =3D> 'Local VPN Hostname/IP', 'localkey' =3D> 'Localkey', 'localkeyfile' =3D> 'Localkeyfile', +'location' =3D> 'Location', 'log' =3D> 'Log', 'log enabled' =3D> 'Log Enabled', 'log level' =3D> 'Log Level', --===============2999034470204918387== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KCmlRRWNCQUVCQ2dBR0JRSldock5PQUFvSkVP eUxhMUM1RWF6citmNElBSUM3djFhaXR1U0E1YkF6UEpSYTlOUCsKU2dEVFdCNEt1UXpibW9xZ3h3 UFR5THZ0TFJ6czdlK3JxM2JQT3plcWNoUjlJSXVJd1M5TzRQWFAvbWtFbzkrRAp6NDRlWHN5WnRo c2p6T2lmTU5zclZaenUyVHhtYkVSQzVQUDljRDVGMHRUZnNKLy80aFJUQXYvSExPbzZQYWpwClYw SWpXTGYvM3hrazl2a1kzOXBFbkJueXZBOEdadzc4RXFtcFBUb1pVSjk0a3dWTkg4amNrS0doRjhq T3NGcDQKQnhDVllmSUk0eXZVTk12Sit0ZWlvenZUbTJOcFRuTUhJMVBlREZpRG1IWFJzT3FITGRx a3hzZ0VpV2gyWFJucgoxaUJnT0VNUWtPUXJGemdxR2VPbSt1ZUt3alRrYUc0TnJJSThMWE95UHZp TFJCbmRSazJsVkxCenNkK2IzMms9Cj1JSksvCi0tLS0tRU5EIFBHUCBTSUdOQVRVUkUtLS0tLQo= --===============2999034470204918387==--