From b9cea121a43244138826c08a582336e74a3f39db Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 9 Jan 2024 20:44:42 +0100 Subject: gegen negative Zeiten rĂ¼sten MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- computer-time-limit.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3-70-g09d2