Fix visibility bypass in export and insecure cookie in preferences
api/export_tickets.php: getAllTickets() was called without $currentUser, so visibility filtering was skipped — any authenticated user could export all tickets including confidential/internal ones. api/user_preferences.php: the single-preference setcookie() call was missing httponly/secure flags (batch path had them correctly). Also cast preference values to string before passing to setPreference(string). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -72,8 +72,8 @@ try {
|
||||
}
|
||||
} else {
|
||||
// Get all tickets with filters (no pagination for export)
|
||||
// getAllTickets already applies visibility filtering via getVisibilityFilter
|
||||
$result = $ticketModel->getAllTickets(1, 10000, $status, 'created_at', 'desc', $category, $type, $search);
|
||||
// Pass $currentUser so visibility filtering is applied correctly
|
||||
$result = $ticketModel->getAllTickets(1, 10000, $status, 'created_at', 'desc', $category, $type, $search, [], $currentUser);
|
||||
$tickets = $result['tickets'];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user