Add file name to shared file download logs

This commit is contained in:
Marcus Hill
2023-01-02 18:35:07 +00:00
parent 4c0acc87b1
commit 0673e550e5
+2 -2
View File
@@ -44,7 +44,7 @@ if(isset($_GET['id']) && isset($_GET['key'])){
exit("No file."); exit("No file.");
} }
$file_name = $file_row['file_name']; $file_name = strip_tags(mysqli_real_escape_string($mysqli, $file_row['file_name']));
$file_ext = $file_row['file_ext']; $file_ext = $file_row['file_ext'];
$file_reference_name = $file_row['file_reference_name']; $file_reference_name = $file_row['file_reference_name'];
$client_id = $file_row['file_client_id']; $client_id = $file_row['file_client_id'];
@@ -62,7 +62,7 @@ if(isset($_GET['id']) && isset($_GET['key'])){
mysqli_query($mysqli, "UPDATE shared_items SET item_views = '$new_item_views' WHERE item_id = '$item_id'"); mysqli_query($mysqli, "UPDATE shared_items SET item_views = '$new_item_views' WHERE item_id = '$item_id'");
// Logging // Logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Sharing', log_action = 'View', log_description = 'Downloaded shared file via link - Item ID: $item_id', log_client_id = '$client_id', log_created_at = NOW(), log_ip = '$ip', log_user_agent = '$user_agent', company_id = '1'"); mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Sharing', log_action = 'View', log_description = 'Downloaded shared file $file_name via link', log_client_id = '$client_id', log_created_at = NOW(), log_ip = '$ip', log_user_agent = '$user_agent', company_id = '1'");
} }