From daba8d2fb8af5cdc7a4f5a37eb8f1f523b4c1020 Mon Sep 17 00:00:00 2001 From: jakani24 Date: Sun, 11 Feb 2024 20:29:42 +0100 Subject: [PATCH] Update get_settings.php --- .../api/php/settings/get_settings.php | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/src/server/cyberhex-code/api/php/settings/get_settings.php b/src/server/cyberhex-code/api/php/settings/get_settings.php index e3a6e45..5129baf 100644 --- a/src/server/cyberhex-code/api/php/settings/get_settings.php +++ b/src/server/cyberhex-code/api/php/settings/get_settings.php @@ -52,7 +52,42 @@ if(isset($_GET["rtp_excluded"])){ $stmt -> close(); } - +if(isset($_GET["sched"])){ + //load all the entrys from a db table + $sql = "SELECT task,id FROM user_tasks ORDER BY id"; + $stmt = $conn->prepare($sql); + // Execute the statement + $stmt->execute(); + // Get the result + $result = $stmt->get_result(); + while ($row = $result->fetch_assoc()){ + $buf=explode(";",$row["task"]); + $time=$buf[0]; + $action=$buf[1]; + $argument=$buf[2]; + $name=$buf[3]; + //e.g.: "43 * * * *" scanfolder "c:\" tsk1 + echo("\"$time\" $action \"$argument\" $name\n"); + } + $stmt -> close(); + $sql = "SELECT task,id FROM system_tasks ORDER BY id"; + $stmt = $conn->prepare($sql); + // Execute the statement + $stmt->execute(); + // Get the result + $result = $stmt->get_result(); + while ($row = $result->fetch_assoc()){ + $buf=explode(";",$row["task"]); + $time=$buf[0]; + $action=$buf[1]; + $argument=$buf[2]; + $name=$buf[3]; + //e.g.: "43 * * * *" scanfolder "c:\" tsk1 + echo("\"$time\" $action \"$argument\" $name\n"); + } + $stmt -> close(); + +} function load_settings(){ global $setting_virus_ctrl_virus_found_action ; global $setting_server_server_url;