diff --git a/src/server/cyberhex-code/install/create_db.php b/src/server/cyberhex-code/install/create_db.php index 8161df0..388fec3 100644 --- a/src/server/cyberhex-code/install/create_db.php +++ b/src/server/cyberhex-code/install/create_db.php @@ -114,6 +114,38 @@ Error creating table settings: ' . $conn->error .' '; } + // Create rtp_included table + $sql = "CREATE TABLE IF NOT EXISTS rtp_included ( + id INT AUTO_INCREMENT PRIMARY KEY, + path VARCHAR(255) NOT NULL UNIQUE, + )"; + + if ($conn->query($sql) === TRUE) { + echo '
'; + } else { + $success=0; + echo '
'; + } + // Create rtp_excluded table + $sql = "CREATE TABLE IF NOT EXISTS rtp_excluded ( + id INT AUTO_INCREMENT PRIMARY KEY, + path VARCHAR(255) NOT NULL UNIQUE, + )"; + + if ($conn->query($sql) === TRUE) { + echo '
'; + } else { + $success=0; + echo '
'; + } // Create api table $sql = "CREATE TABLE IF NOT EXISTS api ( diff --git a/src/server/cyberhex-code/system/secure_zone/php/client_settings.php b/src/server/cyberhex-code/system/secure_zone/php/client_settings.php index 8599bcf..2525a0b 100644 --- a/src/server/cyberhex-code/system/secure_zone/php/client_settings.php +++ b/src/server/cyberhex-code/system/secure_zone/php/client_settings.php @@ -21,12 +21,28 @@ if($perms[5]!=="1"){ $setting_virus_ctrl_virus_found_action = "not configured yet"; $setting_server_server_url="not configured yet"; $setting_rtp_folder_scan_status=0; - +include "../../../config.php"; if(isset($_GET["update"])){ safe_settings(); } +if(isset($_GET["delete"])){ + delete_item(,$_GET["db"],$_GET["delete"]); +} load_settings(); -//db: id,name,value +function delete_item($db,$id){ + include "../../../config.php"; + $conn = new mysqli($DB_SERVERNAME, $DB_USERNAME, $DB_PASSWORD,$DB_DATABASE); + if ($conn->connect_error) { + $success=0; + die("Connection failed: " . $conn->connect_error); + } + $db=htmlspecialchars($db); + $id=htmlspecialchars($id); + $stmt = $conn->prepare("delete from $db where id=$id;"); + $stmt->execute(); + $stmt->close(); + $conn -> close(); +} function safe_settings(){ include "../../../config.php"; $conn = new mysqli($DB_SERVERNAME, $DB_USERNAME, $DB_PASSWORD,$DB_DATABASE); @@ -57,6 +73,12 @@ function safe_settings(){ $stmt->execute(); $stmt->close(); } + if($_GET["update"]=="rtp_included"){ + $stmt = $conn->prepare("INSERT INTO rtp_included (path) VALUES (?) ON DUPLICATE KEY UPDATE path = ?;"); + $stmt->bind_param("ss",$value,$value); + $stmt->execute(); + $stmt->close(); + } $conn->close(); } @@ -108,6 +130,7 @@ function load_settings(){ $setting_server_server_url=$row["value"]; } $stmt -> close(); + $conn -> close(); } ?> @@ -147,6 +170,9 @@ function load_settings(){ var value = element.value; fetch('client_settings.php?update='+name+'&value='+value); } + function delete_item(db,id){ + fetch('client_settings.php?delete='+id+'&db='+db); + }
@@ -182,7 +208,38 @@ function load_settings(){ ?>
- +
Included folders for RTP folderscanner
+ + + + + + + + + + prepare($sql); + // Execute the statement + $stmt->execute(); + // Get the result + $result = $stmt->get_result(); + while ($row = $result->fetch_assoc()){ + //print out the items + echo(""); + echo(""); + echo(""); + echo(""); + echo(""); + } + + $stmt -> close(); + ?> + + +
Excluded folders for RTP folderscanner
#PathDelete
".$row["id"]."