Updated admin posts to use new logAction function, tidy and added more details to logging

This commit is contained in:
johnnyq
2024-11-14 16:07:35 -05:00
parent 8ffa90ae28
commit ef651f5248
26 changed files with 204 additions and 152 deletions

View File

@@ -14,12 +14,13 @@ if (isset($_POST['add_document_template'])) {
$content_raw = sanitizeInput($_POST['name'] . " " . str_replace("<", " <", $_POST['content']));
// Content Raw is used for FULL INDEX searching. Adding a space before HTML tags to allow spaces between newlines, bulletpoints, etc. for searching.
// Document add query
$add_document = mysqli_query($mysqli,"INSERT INTO documents SET document_name = '$name', document_description = '$description', document_content = '$content', document_content_raw = '$content_raw', document_template = 1, document_folder_id = 0, document_created_by = $session_user_id, document_client_id = 0");
// Document create query
mysqli_query($mysqli,"INSERT INTO documents SET document_name = '$name', document_description = '$description', document_content = '$content', document_content_raw = '$content_raw', document_template = 1, document_folder_id = 0, document_created_by = $session_user_id, document_client_id = 0");
$document_id = mysqli_insert_id($mysqli);
// Logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Document Template', log_action = 'Create', log_description = '$session_name created document template $name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_client_id = $client_id, log_user_id = $session_user_id, log_entity_id = $document_id");
logAction("Document Template", "Create", "$session_name created document template $name", $client_id, $document_id);
$_SESSION['alert_message'] = "Document template <strong>$name</strong> created";