Refactor promoteur hub logic and enhance session handling
This commit updates the promoteur hub functionality by introducing a new function, `fxPromoteurHubIsAvailable`, to streamline the logic for determining hub access. The existing `fxPromoteurHubShouldUse` function is modified to incorporate this new check, improving clarity and maintainability. Additionally, comments are added to clarify session handling in the `fxLoginCompte` function, ensuring better understanding of public login behavior. These changes aim to enhance the robustness of the promoteur hub interface and improve code readability.
This commit is contained in:
@ -55,6 +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).
|
||||
if (fxPromoteurHubShouldUse($_SESSION['com_id'])) {
|
||||
$strCode = 'compte_promoteur_hub';
|
||||
} else {
|
||||
@ -65,7 +66,7 @@ else {
|
||||
}
|
||||
}
|
||||
|
||||
if ($strCode === 'compte_promoteur_hub' && (!isset($_SESSION['com_id']) || !fxPromoteurHubShouldUse($_SESSION['com_id']))) {
|
||||
if ($strCode === 'compte_promoteur_hub' && (!isset($_SESSION['com_id']) || !fxPromoteurHubIsAvailable($_SESSION['com_id']))) {
|
||||
header('Location: ' . $vDomaine . '/' . ($strLangue === 'fr' ? 'compte' : 'account'));
|
||||
exit;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user