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.
This commit is contained in:
@ -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 {
|
||||
|
||||
@ -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')
|
||||
|
||||
Reference in New Issue
Block a user