updating settings to allow killing a virus process
This commit is contained in:
@@ -8,6 +8,7 @@ if(check_apikey()!==true){
|
||||
|
||||
$setting_virus_ctrl_virus_found_action = "not configured yet";
|
||||
$setting_server_server_url="not configured yet";
|
||||
$setting_virus_ctrl_virus_process_found_kill=0;
|
||||
$setting_rtp_folder_scan_status=0;
|
||||
$setting_rtp_process_scan_status=0;
|
||||
$setting_communication_unsafe_tls="not coonfigured yet";
|
||||
@@ -27,6 +28,7 @@ if(isset($_GET["settings"])){
|
||||
echo(load_secret()."\n");
|
||||
load_settings();
|
||||
echo("virus_ctrl:virus_found:action ".$setting_virus_ctrl_virus_found_action."\n");
|
||||
echo("virus_ctrl:virus_process:found:kill ".$setting_virus_ctrl_virus_process_found_kill."\n");
|
||||
echo("server:server_url ".$setting_server_server_url."\n");
|
||||
echo("rtp_folder_scan:status ".$setting_rtp_folder_scan_status."\n");
|
||||
echo("rtp_process_scan:status ".$setting_rtp_process_scan_status."\n");
|
||||
@@ -102,7 +104,8 @@ if(isset($_GET["sched"])){
|
||||
|
||||
}
|
||||
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;
|
||||
@@ -125,6 +128,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);
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user