This makes debugging easier, especially when it comes to GeoIP related firewall rules and database related issues such as #11482. Signed-off-by: Peter Müller --- config/rootfiles/core/121/filelists/files | 1 + html/cgi-bin/ovpnmain.cgi | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/config/rootfiles/core/121/filelists/files b/config/rootfiles/core/121/filelists/files index 4ce37f9ed..654460b72 100644 --- a/config/rootfiles/core/121/filelists/files +++ b/config/rootfiles/core/121/filelists/files @@ -1,3 +1,4 @@ etc/system-release etc/issue etc/ssl/certs/ca-bundle.crt +srv/web/ipfire/cgi-bin/ovpnmain.cgi diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi index 94e723ba2..eac962e6c 100644 --- a/html/cgi-bin/ovpnmain.cgi +++ b/html/cgi-bin/ovpnmain.cgi @@ -35,6 +35,7 @@ require '/var/ipfire/general-functions.pl'; require "${General::swroot}/lang.pl"; require "${General::swroot}/header.pl"; require "${General::swroot}/countries.pl"; +require "${General::swroot}/geoip-functions.pl"; # enable only the following on debugging purpose #use warnings; @@ -2991,6 +2992,7 @@ END $Lang::tr{'common name'} $Lang::tr{'real address'} + $Lang::tr{'country'} $Lang::tr{'virtual address'} $Lang::tr{'loged in at'} $Lang::tr{'bytes sent'} @@ -3030,6 +3032,11 @@ END $users[$uid]{'BytesSent'} = &sizeformat($match[4]); $users[$uid]{'Since'} = $match[5]; $users[$uid]{'Proto'} = $proto; + + # get country code for "RealAddress"... + my $ccode = &GeoIP::lookup((split ':', $users[$uid]{'RealAddress'})[0]); + my $flag_icon = &GeoIP::get_flag_icon($ccode); + $users[$uid]{'Country'} = "$ccode"; $uid++; } } @@ -3056,7 +3063,8 @@ END } print "$users[$idx-1]{'CommonName'}"; print "$users[$idx-1]{'RealAddress'}"; - print "$users[$idx-1]{'VirtualAddress'}"; + print "$users[$idx-1]{'Country'}"; + print "$users[$idx-1]{'VirtualAddress'}"; print "$users[$idx-1]{'Since'}"; print "$users[$idx-1]{'BytesSent'}"; print "$users[$idx-1]{'BytesReceived'}"; -- 2.13.6