Finished Updating admin / settings posts to use new logAction function, tidy and added more details to logging

This commit is contained in:
johnnyq
2024-11-14 17:20:52 -05:00
parent ef651f5248
commit 5bdd5d1f79
8 changed files with 95 additions and 72 deletions

View File

@@ -17,10 +17,12 @@ if (isset($_POST['add_software_template'])) {
mysqli_query($mysqli,"INSERT INTO software SET software_name = '$name', software_version = '$version', software_description = '$description', software_type = '$type', software_license_type = '$license_type', software_notes = '$notes', software_template = 1, software_client_id = 0");
//Logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Software Template', log_action = 'Create', log_description = '$session_user_name created software template $name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id");
$software_id = mysqli_insert_id($mysqli);
$_SESSION['alert_message'] = "Software template created";
// Logging
logAction("Software Template", "Create", "$session_name created software template $name", 0, $software_id);
$_SESSION['alert_message'] = "Software template <strong>$name</strong> created";
header("Location: " . $_SERVER["HTTP_REFERER"]);
@@ -38,10 +40,10 @@ if (isset($_POST['edit_software_template'])) {
mysqli_query($mysqli,"UPDATE software SET software_name = '$name', software_version = '$version', software_description = '$description', software_type = '$type', software_license_type = '$license_type', software_notes = '$notes' WHERE software_id = $software_id");
//Logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Software Teplate', log_action = 'Modify', log_description = '$session_name modified software template $name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id");
// Logging
logAction("Software Template", "Edit", "$session_name edited software template $name", 0, $software_id);
$_SESSION['alert_message'] = "Software template updated";
$_SESSION['alert_message'] = "Software template <strong>$name</strong> edited";
header("Location: " . $_SERVER["HTTP_REFERER"]);