57 lines
1.9 KiB
PHP
57 lines
1.9 KiB
PHP
<?php
|
|
|
|
/**
|
|
* MSIN-4401 — Gestion des accès V2 (promoteur, par événement).
|
|
* Les POST invite/revoke sont traités dans compte.php AVANT inc_header (évite page blanche).
|
|
*/
|
|
|
|
include_once('php/inc_fx_promoteur.php');
|
|
require_once('php/inc_fx_eve_acces.php');
|
|
require_once('php/inc_fx_eve_acces_promoteur.php');
|
|
require_once('php/inc_v2_assets.php');
|
|
|
|
global $objDatabase, $vDomaine, $strLangue;
|
|
|
|
$intEveId = 0;
|
|
if (isset($_GET['promoteur_eve_id'])) {
|
|
$intEveId = intval(base64_decode(urldecode($_GET['promoteur_eve_id'])));
|
|
}
|
|
|
|
$strLangue = ($strLangue === 'en') ? 'en' : 'fr';
|
|
$strBasePath = ($strLangue === 'en') ? '/account' : '/compte';
|
|
// MSIN-4399 — deny : hub + focus si dispo, sinon ancien tableau.
|
|
if (!function_exists('fxPromoteurHubOrLegacyBackUrl')) {
|
|
require_once __DIR__ . '/php/inc_fx_promoteur_hub.php';
|
|
}
|
|
$strRedirect = ($intEveId > 0)
|
|
? fxPromoteurHubOrLegacyBackUrl($intEveId, $strLangue)
|
|
: ($vDomaine . $strBasePath);
|
|
|
|
$intActor = intval($_SESSION['com_id'] ?? 0);
|
|
if (!empty($_SESSION['usa_id'])) {
|
|
$intActor = intval($_SESSION['usa_id']);
|
|
}
|
|
|
|
if ($intEveId <= 0
|
|
|| (empty($_SESSION['com_id']) && empty($_SESSION['usa_id']))
|
|
|| !fxEveAccesCanTeamInvite($intActor, $intEveId)) {
|
|
// Headers déjà envoyés (include après layout) : message + lien, pas de header Location.
|
|
echo '<div class="alert alert-warning">';
|
|
echo fxEveAccesPromoteurEsc(fxEveAccesPromoteurT('eve_acces_promoteur_access_denied', $strLangue));
|
|
echo ' <a href="' . htmlspecialchars($strRedirect, ENT_QUOTES, 'UTF-8') . '">';
|
|
echo fxEveAccesPromoteurEsc(fxEveAccesPromoteurT('eve_acces_promoteur_btn_back', $strLangue));
|
|
echo '</a></div>';
|
|
return;
|
|
}
|
|
|
|
$strFlash = '';
|
|
$strError = '';
|
|
if (!empty($_GET['ok'])) {
|
|
$strFlash = (string)$_GET['ok'];
|
|
}
|
|
if (!empty($_GET['err'])) {
|
|
$strError = (string)$_GET['err'];
|
|
}
|
|
|
|
fxEveAccesPromoteurRenderPage($intEveId, $strLangue, $strFlash, $strError);
|