mirror of https://github.com/itflow-org/itflow
Functionalize logging, replaced old logging in contact add with new logging function
This commit is contained in:
parent
3d5e1a1811
commit
7b4dda0ad6
|
|
@ -1336,4 +1336,10 @@ function appNotify($type, $details, $action = null, $client_id = 0, $entity_id =
|
|||
|
||||
mysqli_query($mysqli, "INSERT INTO notifications SET notification_type = '$type', notification = '$details', notification_action = '$action', notification_client_id = $client_id, notification_entity_id = $entity_id, notification_user_id = $user_id");
|
||||
}
|
||||
}
|
||||
|
||||
function logAction($type, $action, $description, $client_id = 0, $entity_id = 0) {
|
||||
global $mysqli, $session_user_agent, $session_ip, $session_user_id;
|
||||
|
||||
mysqli_query($mysqli, "INSERT INTO logs SET log_type = '$type', log_action = '$action', log_description = '$description', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_client_id = $client_id, log_user_id = $session_user_id, log_entity_id = $entity_id");
|
||||
}
|
||||
|
|
@ -64,7 +64,9 @@ if (isset($_POST['add_contact'])) {
|
|||
}
|
||||
|
||||
//Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Contact', log_action = 'Create', log_description = '$session_name created contact $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 = $contact_id");
|
||||
logAction("Contact", "Create", "$session_name created contact $name", $client_id, $contact_id);
|
||||
|
||||
//mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Contact', log_action = 'Create', log_description = '$session_name created contact $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 = $contact_id");
|
||||
|
||||
customAction('contact_create', $contact_id);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue