mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
fix: add missing csrf_token to htmx checkbox in file access restrictions
The 'Activer la restriction d'accès' checkbox in /admin/acces.php used htmx to POST to settings.php but the #fieldset-restrictions container was missing a csrf_token hidden input. This caused two bugs: 1. 'Erreur de sécurité, token invalide' error 2. Full /admin/parametres.php HTML injected into #restrictions-response (due to HTMX following the 302 redirect on CSRF failure)
This commit is contained in:
@@ -338,6 +338,7 @@
|
||||
hx-target="#restrictions-response"
|
||||
hx-swap="innerHTML"
|
||||
hx-include="#fieldset-restrictions">
|
||||
<input type="hidden" name="csrf_token" value="<?= htmlspecialchars($_SESSION['csrf_token']) ?>">
|
||||
<input type="hidden" name="section" value="formulaire_restrictions">
|
||||
<strong>Activer la restriction d'accès</strong><br>
|
||||
<small style="max-width:42ch;">Pour les TFE de type "Interne", masquer les fichiers et exiger une demande d'accès par email. Les métadonnées et résumés restent publics.</small>
|
||||
|
||||
Reference in New Issue
Block a user