From e9ad3d8a9285eb7c98da1dd735bd52d40a4d86c8 Mon Sep 17 00:00:00 2001 From: stephan Date: Fri, 19 Jun 2026 12:49:19 -0400 Subject: [PATCH] Enhance event access control and integrate new permission checks This commit introduces the `fxEveAccesCanManageBibV4` and `fxEveAccesCanQrTest` functions to improve event access management. It updates various files to utilize these new permission checks, ensuring that only authorized users can manage event registrations and access QR testing features. Additionally, redundant session checks are removed, and redirection logic is refined for better user experience across the application. --- compte.php | 8 ++- inc_tableau_gestion_epreuves.php | 31 ++++------ inc_tableau_promoteur.php | 3 +- php/inc_fx_eve_acces.php | 37 ++++++++++++ php/inc_fx_promoteur.php | 36 +++++++++++- qr_test.php | 13 +++++ sql/MSIN-eve-acces-v2-bib-qr-seed.sql | 82 +++++++++++++++++++++++++++ 7 files changed, 188 insertions(+), 22 deletions(-) create mode 100644 sql/MSIN-eve-acces-v2-bib-qr-seed.sql diff --git a/compte.php b/compte.php index d13dbb1..5ccfbb1 100644 --- a/compte.php +++ b/compte.php @@ -22,6 +22,7 @@ require_once('superadm/php/inc_fx_excell.php'); require_once('php/inc_fx_liste_attente.php'); require_once('php/inc_fx_inscriptions_mobile.php'); +require_once('php/inc_fx_eve_acces.php'); global $objDatabase, $vPage, $vDomaine; // vérifier les paramètres @@ -314,6 +315,11 @@ if (isset($_GET['promoteur_eve_id'])) { header('Location: ' . $vDomaine . '/' . $strPage); exit; } + } elseif ($strCode === 'compte_inc_tableau_gestion_epreuves') { + if (!fxEveAccesCanManageBibV4($_SESSION['com_id'] ?? 0, $intEveIdbase)) { + header('Location: ' . $vDomaine . '/' . $strPage); + exit; + } } elseif (!fxIsPromoteur($_SESSION['com_id'], $intEveIdbase)) { header('Location: ' . $vDomaine . '/' . $strPage); exit; @@ -471,7 +477,7 @@ require_once("inc_header.php"); break; case 'compte_accueil': //MSIN-4371 - if (isset($_SESSION['usa_id'])) { ?> + if (fxEveAccesCanQrTest($_SESSION['com_id'])) { ?> QR Test diff --git a/inc_tableau_gestion_epreuves.php b/inc_tableau_gestion_epreuves.php index 8dcda63..da2ce48 100644 --- a/inc_tableau_gestion_epreuves.php +++ b/inc_tableau_gestion_epreuves.php @@ -1,22 +1,14 @@ @@ -56,8 +57,7 @@ if (isset($_POST['btn_cancel_event_promo'])) { fxAnnulerRetablirInscription($tabEpreuve, $int_pec_id); } -if ($intEveId != 0) { - ?> +?>