From patchwork Mon Apr 13 07:45:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 2949 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4910zs4hRrz3yBt for ; Mon, 13 Apr 2020 07:46:17 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4910zf4HqJz2fm; Mon, 13 Apr 2020 07:46:06 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4910zf31tTz2yRK; Mon, 13 Apr 2020 07:46:06 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4910zc4VlRz30F6 for ; Mon, 13 Apr 2020 07:46:04 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 4910zY2y5Lz2kn; Mon, 13 Apr 2020 07:46:01 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1586763961; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Yde0STqhFuWSqnbcNhKIeKRk8iqowN/06SiP0uOfPq4=; b=SU6jlNxZYrzVUF+BhrZ8O0kV4RV298EDFIk+zEwhdjMDhPCIehCqFhT+WLFX1/0f91U82I beXjvV5kOvK+L3CQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1586763961; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Yde0STqhFuWSqnbcNhKIeKRk8iqowN/06SiP0uOfPq4=; b=KYCNS/lNbIu6/ulD2h52wo+rszh0se0c1Brx0y3W3eBHekr2lfCxs3e7bBZzMOi4XGN8Es KnApPC4++xFhrFDCb26KDuykCHAtYALvEGkMfQKS0QHjqqOLcd0MN5KeZC5nPwdBzgsBIu pDMwVHlvRNW5QF929ozx/QhywfhzItUd25gQShPS/G1yEDPzf+J5tiaYgtDLdojIBHaD1h ICFscWDP6az6oHS2RRVZpCUhcYEcT8ez5cQ/zZo+DUfbTPZZ5NA3J/1Y6zBjpfsaWZaYXV pf+wvr1jrUUT3G+JQlMhAjXqHTWRbs75FsHfPFW0tOv6z6zOB5l1Cyobdc1bbw== 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> References: <20200413074550.2735-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.mailfrom=stefan.schantl@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" 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/ovpnclients.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 = $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 1d3b87649..171d24937 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.',