Files
ms1inscription-v5/php/inc_start_time.php
stephan abb63c293f Enhance session management and access control for super admins
This commit introduces improvements to session management by implementing a new check for super admin sessions, allowing them to bypass certain access restrictions. It updates the logout function to retain super admin session data and modifies event access functions to grant permissions based on super admin status. Additionally, the session timeout duration is adjusted for better alignment with site requirements. The version code is updated to reflect these changes.
2026-07-01 13:48:43 -04:00

51 lines
1.3 KiB
PHP

<?php
require_once __DIR__ . '/inc_cookie_consent.php';
fxCookiesConsentResetIfRequested();
// a faire trouver une solution
//ini_set('session.cookie_domain', '.ms1inscriptiondev.interne.ca');
//ini_set('session.cookie_domain', '.ms1inscription.com');
//ini_set('session.cookie_domain', '.ms1inscriptiondev.progiweb.net');
$host = $_SERVER['HTTP_HOST'];
// Enlève "www." s'il est présent
$host = preg_replace('/^www\./', '', $host);
// Enlève "preprod." s'il est présent
$host = preg_replace('/^preprod\./', '', $host);
// Pas de point au début
$cookie_domain = $host;
ini_set('session.cookie_domain', $cookie_domain);
//echo($cookie_domain);
// Démarrez la session
session_start();
// Temps de la session = 60 min
// MSIN-CON-259
//ini_set('session.gc_maxlifetime', 10800);
$inactive = 10800;
if (isset($_SESSION['date_maj']) && (time() - $_SESSION['date_maj'] > $inactive)) {
if (isset($_SESSION['com_info']) && $_SESSION['com_id'] > 0) {
require_once('php/inc_fonctions.php');
require_once('php/inc_fx_panier.php');
require_once('php/inc_fx_compte.php');
fxLogout($_GET['lang']);
}
}
/* if (!isset($_SESSION['no_panier']) && isset($_COOKIE['no_panier']))
$_SESSION['no_panier'] = $_COOKIE['no_panier']; */
$_SESSION['date_maj'] = time();
if (!empty($_SESSION['usa_id'])) {
$_SESSION['logged'] = time();
}