This commit updates the mobile registration access checks across multiple files to use the newly implemented `fxInscrMobileCanAccess` and `fxInscrMobileCanScan` functions. The changes enhance the permission handling for mobile event registrations, ensuring a more robust access control mechanism. Additionally, the mobile URL generation is updated for consistency, and new functions for managing event access permissions are introduced to streamline the codebase.
43 lines
1.0 KiB
PHP
43 lines
1.0 KiB
PHP
<?php
|
|
|
|
session_start();
|
|
|
|
require_once 'php/inc_fonctions.php';
|
|
require_once 'php/inc_fx_inscriptions_mobile.php';
|
|
|
|
global $vDomaine;
|
|
|
|
$strLangue = 'fr';
|
|
if (!empty($_REQUEST['lang'])) {
|
|
$strLangue = $_REQUEST['lang'];
|
|
}
|
|
|
|
$vPage = 'compte.php';
|
|
$vtexte_page = obtenirTextepage($vPage, $strLangue, 2);
|
|
|
|
header('Content-Type: application/json; charset=utf-8');
|
|
|
|
if (!isset($_SESSION['com_id'])) {
|
|
echo json_encode(array('state' => 'error', 'message' => fxInscrMobileT('inscr_mobile_qr_invalid')));
|
|
exit;
|
|
}
|
|
|
|
$intEveId = 0;
|
|
if (!empty($_REQUEST['promoteur_eve_id'])) {
|
|
$intEveId = fxInscrMobileParseEveId($_REQUEST['promoteur_eve_id']);
|
|
}
|
|
|
|
if ($intEveId <= 0 || !fxInscrMobileCanScan($_SESSION['com_id'], $intEveId)) {
|
|
echo json_encode(array('state' => 'error', 'message' => fxInscrMobileT('inscr_mobile_qr_invalid')));
|
|
exit;
|
|
}
|
|
|
|
$strRaw = '';
|
|
if (!empty($_REQUEST['qr'])) {
|
|
$strRaw = $_REQUEST['qr'];
|
|
} elseif (!empty($_REQUEST['t'])) {
|
|
$strRaw = $_REQUEST['t'];
|
|
}
|
|
|
|
echo json_encode(fxInscrMobileResolveQrScan($strRaw, $intEveId, $strLangue));
|