getIdentity(); if ($user->guest || !in_array(5, $user->groups)) { // Modifier '5' par l'ID du groupe Joomla autorisé header("HTTP/1.1 403 Forbidden"); exit("Accès interdit"); } // Lire le fichier sécurisé $filePath = '/home/user/protected_files/document.pdf'; if (!file_exists($filePath)) { header("HTTP/1.1 404 Not Found"); exit("Fichier introuvable"); } header('Content-Type: application/pdf'); header('Content-Disposition: attachment; filename="document.pdf"'); readfile($filePath); exit;