fix: Fix upload_attachment.php AuditLogModel call
- Fix AuditLogModel instantiation with proper $conn parameter - Fix log() call parameter order (details should be array, not ipAddress) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -171,20 +171,28 @@ try {
|
||||
}
|
||||
|
||||
// Log the upload
|
||||
$auditLog = new AuditLogModel();
|
||||
$conn = new mysqli(
|
||||
$GLOBALS['config']['DB_HOST'],
|
||||
$GLOBALS['config']['DB_USER'],
|
||||
$GLOBALS['config']['DB_PASS'],
|
||||
$GLOBALS['config']['DB_NAME']
|
||||
);
|
||||
if (!$conn->connect_error) {
|
||||
$auditLog = new AuditLogModel($conn);
|
||||
$auditLog->log(
|
||||
$_SESSION['user']['user_id'],
|
||||
'attachment_upload',
|
||||
'ticket_attachments',
|
||||
$attachmentId,
|
||||
null,
|
||||
json_encode([
|
||||
(string)$attachmentId,
|
||||
[
|
||||
'ticket_id' => $ticketId,
|
||||
'filename' => $originalFilename,
|
||||
'size' => $file['size'],
|
||||
'mime_type' => $mimeType
|
||||
])
|
||||
]
|
||||
);
|
||||
$conn->close();
|
||||
}
|
||||
|
||||
ResponseHelper::created([
|
||||
'attachment_id' => $attachmentId,
|
||||
|
||||
Reference in New Issue
Block a user