]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
ovpnclients.dat: Display error when the to date is not later than the
authorStefan Schantl <stefan.schantl@ipfire.org>
Mon, 30 Mar 2020 10:02:46 +0000 (12:02 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Mon, 30 Mar 2020 10:02:46 +0000 (12:02 +0200)
from date.

Signed-off-by: Stefan Schantl <stefan.schantl@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 171d24937256ae745113779a57f3a0b71b0d9c4c..3d07473e71c82b41cc2c6bd4c080b418fc687d4a 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:',