From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 09/19] ovpnclients.dat: Display a notice if there are no entries. Date: Mon, 13 Apr 2020 09:45:40 +0200 Message-ID: <20200413074550.2735-9-stefan.schantl@ipfire.org> In-Reply-To: <20200413074550.2735-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8562590132139189349==" List-Id: --===============8562590132139189349== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Signed-off-by: Stefan Schantl --- html/cgi-bin/logs.cgi/ovpnclients.dat | 7 ++++++- langs/en/cgi-bin/en.pl | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/html/cgi-bin/logs.cgi/ovpnclients.dat b/html/cgi-bin/logs.cgi/ov= pnclients.dat index cf3e0e7bc..b84c2b8d7 100755 --- a/html/cgi-bin/logs.cgi/ovpnclients.dat +++ b/html/cgi-bin/logs.cgi/ovpnclients.dat @@ -293,8 +293,13 @@ while(my @row =3D $statement_handle->fetchrow_array()) { =20 # Increase lines count. $lines++; +} =20 - } +# 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"; +} =20 print "
\n"; =20 diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 1d3b87649..171d24937 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -1800,6 +1800,7 @@ 'no alcatelusb firmware' =3D> 'No Alcatel USB firmware. Please upload.', 'no cfg upload' =3D> 'No data was uploaded', 'no dhcp lease' =3D> 'No DHCP lease has been acquired', +'no entries' =3D> 'No entries at the moment.', 'no eciadsl synch.bin file' =3D> 'No ECI ADSL synch.bin file. Please upload.= ', 'no filter pass' =3D> 'Enter the standard class for non-filtered packets.', 'no fritzdsl driver' =3D> 'No Fritz!DSL driver. Please upload.', --=20 2.26.0 --===============8562590132139189349==--