From 9f1f4a4756a280c81bd126bc6749146694fd7a9a Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 3 May 2024 18:06:29 +0200 Subject: computer-time-limit.php: no computer time at week days before 16:00 --- computer-time-limit.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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]; -- cgit v1.2.3-70-g09d2