summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2024-01-09 20:44:42 +0100
committerErich Eckner <git@eckner.net>2024-01-09 20:44:42 +0100
commitb9cea121a43244138826c08a582336e74a3f39db (patch)
treec54c1c8b62b5b337286765533a9d037794ed472f
parent7b79ed1ac2886672e9394de294d38ed8d6c19e2e (diff)
downloadcomputer-time-limit-b9cea121a43244138826c08a582336e74a3f39db.tar.xz
gegen negative Zeiten rüsten
-rw-r--r--computer-time-limit.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/computer-time-limit.php b/computer-time-limit.php
index a00a9b1..7cc57fb 100644
--- a/computer-time-limit.php
+++ b/computer-time-limit.php
@@ -32,10 +32,15 @@ if (array_key_exists('msg', $_POST) && array_key_exists('sig', $_POST)) {
print($key . ' is not known.');
die();
}
+ $aktiv = $row['aktiv'];
$bis = strtotime($row['bis']);
$von = strtotime($row['von']);
+ if ($bis < $von) {
+ $aktiv = 0;
+ $bis = $von;
+ }
$bis = $bis + 30*60*(floor(time()/60/60/24) - floor($von/60/60/24));
- if ($row['aktiv']) {
+ if ($aktiv) {
$von = time();
}
$noch = $bis - $von;