From patchwork Mon Apr 13 07:45:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 2950 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 4910zv02fsz3yC0 for ; Mon, 13 Apr 2020 07:46:19 +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 4910zf6gH5z2qC; 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 4910zf5NhPz2y3R; 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 4910zc4lxcz30FG 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 4910zZ1tXVz2jN; Mon, 13 Apr 2020 07:46:02 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1586763962; 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=+QJN2YvmOykL+wpu9mrnFaHJxFnyoQXiM7fovOw5cUI=; b=LjLOGlrH1uvAUI+a9FBpaNcHvGOkt1y5zJz18TBq48fngg5bbeZ+SaBgdg3Z7glrJ1KwO1 9VTlskmh6NWlCJAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1586763962; 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=+QJN2YvmOykL+wpu9mrnFaHJxFnyoQXiM7fovOw5cUI=; b=RKr+CCcsF09Ri9CDt/IdQlerQBgPOG8z9oRfmIxC48g1IGNCiCmuu7Bqqvlrr1BuIem9Ou F7NGWGEcebtpyITfyqLMJDo/QeXV9Ez52I8PxFUc86KCjTbCWQA4nNTTbRxoZqTjKyVYro Y9NkSxXRNDj7++PfVC67yyFYZFd+Xk7f2NklmKguvGGpSCPz5SqzBTWSTwpwJ5JVXO53NG CDjOeSkSAsqdSVvdZI+bqWMT7A2xVffiCNGrW6LXvW7/gT6YzNwX0j9uwu9NPRJSpgnRpX dDWWLB6yALrS2p+7wg9WkNd+GIQwzscPrpcMGCL2WPDvMH2BvlOuzxmoNbHh6w== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 10/19] ovpnclients.dat: Display error when the to date is not later than the from date. Date: Mon, 13 Apr 2020 09:45:41 +0200 Message-Id: <20200413074550.2735-10-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 | 5 +++++ langs/en/cgi-bin/en.pl | 1 + 2 files changed, 6 insertions(+) diff --git a/html/cgi-bin/logs.cgi/ovpnclients.dat b/html/cgi-bin/logs.cgi/ovpnclients.dat index b84c2b8d7..a83a0bca9 100755 --- a/html/cgi-bin/logs.cgi/ovpnclients.dat +++ b/html/cgi-bin/logs.cgi/ovpnclients.dat @@ -90,6 +90,11 @@ my $database_handle = DBI->connect("DBI:SQLite:dbname=$database", "", "", { Rais my $from_datestring = sprintf '%04d-%02d-%02d', ($cgiparams{"FROM_YEAR"}, $cgiparams{"FROM_MONTH"}, $cgiparams{"FROM_DAY"}); my $to_datestring = sprintf '%04d-%02d-%02d', ($cgiparams{"TO_YEAR"}, $cgiparams{"TO_MONTH"}, $cgiparams{"TO_DAY"}); +# Check if the to datestring is later than the from datestring. +unless ($to_datestring ge $from_datestring) { + $errormessage = "$Lang::tr{'error the to date has to be later than the from date'}"; +} + my $database_query = qq( SELECT common_name, SUM( diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 171d24937..3d07473e7 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -1012,6 +1012,7 @@ 'error config' => 'Could not open /var/ipfire/ovpn/config/ZERINA.ovpn !', 'error external access' => 'Could not open /var/ipfire/xtaccess/config (external acccess could not be granted)!', 'error messages' => 'Error messages', +'error the to date has to be later than the from date' => 'The to date has to be later than the from date!', 'esp encryption' => 'ESP Encryption:', 'esp grouptype' => 'ESP Grouptype:', 'esp integrity' => 'ESP Integrity:',