diff options
author | Erich Eckner <git@eckner.net> | 2024-05-03 18:06:29 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2024-05-03 18:06:29 +0200 |
commit | 9f1f4a4756a280c81bd126bc6749146694fd7a9a (patch) | |
tree | 4aa88d1b622068292b638468e0842677f9ebd06b /computer-time-limit.php | |
parent | 063d09d8438cb25e7212d3b656f2eba4f2b4622b (diff) | |
download | computer-time-limit-9f1f4a4756a280c81bd126bc6749146694fd7a9a.tar.xz |
computer-time-limit.php: no computer time at week days before 16:00
Diffstat (limited to 'computer-time-limit.php')
-rw-r--r-- | computer-time-limit.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/computer-time-limit.php b/computer-time-limit.php index c97db5e..9619066 100644 --- a/computer-time-limit.php +++ b/computer-time-limit.php @@ -61,7 +61,13 @@ if (array_key_exists('msg', $_POST) && array_key_exists('sig', $_POST)) { $msg_parts = explode(' ', $_POST['msg'], 2); - print($noch . "\n"); + date_default_timezone_set('Europe/Berlin'); + if ((1<=date('w')) && (date('w')<=5) && (date('G')<16)) { + print("0\n"); + } else { + print($noch . "\n"); + } + switch ($msg_parts[1]) { case 'start': $host = $msg_parts[0]; |