diff options
Diffstat (limited to 'computer-time-limit.php')
-rw-r--r-- | computer-time-limit.php | 7 |
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; |