updating settings to allow killing a virus process

This commit is contained in:
jakani24
2024-03-11 13:43:03 +01:00
parent e98dad70cc
commit cd0c707291
21 changed files with 229 additions and 65 deletions

View File

@@ -19,6 +19,7 @@ if($perms[5]!=="1"){
$block=0;
}
$setting_virus_ctrl_virus_found_action = "not configured yet";
$setting_virus_ctrl_virus_process_found_kill = 0;
$setting_communication_unsafe_tls = "not configured yet";
$setting_server_server_url="not configured yet";
$setting_rtp_folder_scan_status=0;
@@ -155,6 +156,16 @@ load_settings();
</ul>
</div>
<br>
<h7>Kill processes which are detected to be a virus?</h7>
<div class="form-check form-switch">
<?php if($setting_virus_ctrl_virus_process_found_kill=="true")
echo ("<input class=\"form-check-input\" type=\"checkbox\" role=\"switch\" id=\"kill_virus_process\" onclick=\"update_switch('kill_virus_process','setting_virus_ctrl_virus_process_found_kill')\" checked>");
else
echo ("<input class=\"form-check-input\" type=\"checkbox\" role=\"switch\" id=\"kill_virus_process\" onclick=\"update_switch('kill_virus_process','setting_virus_ctrl_virus_process_found_kill')\">");
?>
<label class="form-check-label" for="flexSwitchCheckDefault">Check file modifications</label>
</div>
<br>
<h7>Allow communication with unsafe ssl cert? (if you are using self signed certs, activate this option)</h7>
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton2" data-bs-toggle="dropdown" aria-expanded="false">

View File

@@ -46,6 +46,13 @@ function safe_settings(){
$stmt->execute();
$stmt->close();
}
if($_GET["update"]=="setting_virus_ctrl_virus_process_found_kill"){
$stmt = $conn->prepare("INSERT INTO settings (name,value) VALUES (?,?) ON DUPLICATE KEY UPDATE value = ?;");
//$stmt = $conn->prepare("UPDATE settings set value=? WHERE name='virus_ctrl:virus_found:action';");
$stmt->bind_param("sss",$name,$value,$value);
$stmt->execute();
$stmt->close();
}
if($_GET["update"]=="setting_server_server_url"){
$stmt = $conn->prepare("INSERT INTO settings (name,value) VALUES (?,?) ON DUPLICATE KEY UPDATE value = ?;");
@@ -103,7 +110,8 @@ function safe_settings(){
}
function load_settings(){
global $setting_virus_ctrl_virus_found_action ;
global $setting_virus_ctrl_virus_found_action;
global $setting_virus_ctrl_virus_process_found_kill;
global $setting_server_server_url;
global $setting_rtp_folder_scan_status;
global $setting_rtp_process_scan_status;
@@ -126,6 +134,19 @@ function load_settings(){
}
$stmt -> close();
//get setting: setting_virus_ctrl_virus_process_found_kill
$sql = "SELECT * FROM settings WHERE name = 'setting_virus_ctrl_virus_process_found_kill'";
$stmt = $conn->prepare($sql);
// Execute the statement
$stmt->execute();
// Get the result
$result = $stmt->get_result();
$row = $result->fetch_assoc();
if($result->num_rows > 0){
$setting_virus_ctrl_virus_process_found_kill=$row["value"];
}
$stmt -> close();
//get setting: setting_rtp_folder_scan_status
$sql = "SELECT * FROM settings WHERE name = 'setting_rtp_folder_scan_status'";
$stmt = $conn->prepare($sql);