Open wrongecho opened 1 month ago
If we convert logging to a function, we can save on a lot of repetition, e.g.
Something like logAction( type , action , description , client_id (nullable) , entity_id (nullable) )
Would convert the below: mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Interface', log_action = 'Delete', log_description = '$session_name deleted interface $interface_name from asset $asset_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 = $asset_id");
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Interface', log_action = 'Delete', log_description = '$session_name deleted interface $interface_name from asset $asset_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 = $asset_id");
into: logAction('Interface', 'Delete', '$session_name deleted interface $interface_name from asset $asset_name', $client_id, $asset_id);
logAction('Interface', 'Delete', '$session_name deleted interface $interface_name from asset $asset_name', $client_id, $asset_id
Hey @wrongecho this would be fantastic totally up for this
If we convert logging to a function, we can save on a lot of repetition, e.g.
Something like logAction( type , action , description , client_id (nullable) , entity_id (nullable) )
Would convert the below:
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Interface', log_action = 'Delete', log_description = '$session_name deleted interface $interface_name from asset $asset_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 = $asset_id");
into:
logAction('Interface', 'Delete', '$session_name deleted interface $interface_name from asset $asset_name', $client_id, $asset_id
);