]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/logs.cgi/ovpnclients.dat
ovpnclients.dat: Display error when the to date is not later than the from date.
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / logs.cgi / ovpnclients.dat
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(