From: Stefan Schantl Date: Mon, 30 Mar 2020 09:34:53 +0000 (+0200) Subject: ovpnclients.dat: Display a notice if there are no entries. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6b3650c81d937bfc470d66848a4fff653b154db8;p=people%2Fstevee%2Fipfire-2.x.git ovpnclients.dat: Display a notice if there are no entries. Signed-off-by: Stefan Schantl --- diff --git a/html/cgi-bin/logs.cgi/ovpnclients.dat b/html/cgi-bin/logs.cgi/ovpnclients.dat index cf3e0e7bc0..b84c2b8d7b 100755 --- a/html/cgi-bin/logs.cgi/ovpnclients.dat +++ b/html/cgi-bin/logs.cgi/ovpnclients.dat @@ -293,8 +293,13 @@ while(my @row = $statement_handle->fetchrow_array()) { # Increase lines count. $lines++; +} - } +# If nothing has been fetched, the amount of lines is still zero. +# In this case display a hint about no data. +unless ($lines) { + print "$Lang::tr{'no entries'}\n"; +} print "
\n"; diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 1d3b87649a..171d249372 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -1800,6 +1800,7 @@ 'no alcatelusb firmware' => 'No Alcatel USB firmware. Please upload.', 'no cfg upload' => 'No data was uploaded', 'no dhcp lease' => 'No DHCP lease has been acquired', +'no entries' => 'No entries at the moment.', 'no eciadsl synch.bin file' => 'No ECI ADSL synch.bin file. Please upload.', 'no filter pass' => 'Enter the standard class for non-filtered packets.', 'no fritzdsl driver' => 'No Fritz!DSL driver. Please upload.',