]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
ovpnclients.dat: Display error when the to date is not later than the from date.
authorStefan Schantl <stefan.schantl@ipfire.org>
Mon, 13 Apr 2020 07:45:41 +0000 (09:45 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Fri, 1 May 2020 19:14:11 +0000 (19:14 +0000)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
html/cgi-bin/logs.cgi/ovpnclients.dat
langs/en/cgi-bin/en.pl

index b84c2b8d7baec5b7deb940a07c28c193a059fd43..a83a0bca91acf99fb01a9ccf30281cac7d14ae72 100755 (executable)
@@ -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(
index 95e25ae0cd0c6d7435f41c3c1fab10305f294f2c..fb30bd69a339d8cab4430324503df159ac4eae3b 100644 (file)
 '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:',