Esempio n. 1
0
}
CSessionHandler::setHandler(CAppUI::conf("session_handler"));
// Start session
CSessionHandler::start();
// Ignore aborted HTTP request, so that PHP finishes the current script
ignore_user_abort(true);
// Register shutdown function to end the session
register_shutdown_function(array("CSessionHandler", "writeClose"));
// Check if the session was made via a temporary token
// and save its expiration date
if (isset($_SESSION["token_expiration"])) {
    CAppUI::$token_expiration = $_SESSION["token_expiration"];
}
// Reset session if it expired
if (CAppUI::isTokenSessionExpired()) {
    CAppUI::$token_expiration = null;
    // Free the session data
    CSessionHandler::end(true);
    // Start it back
    CSessionHandler::start();
}
// Check if session has previously been initialised
if (empty($_SESSION["AppUI"]) || isset($_GET["logout"])) {
    $_SESSION["AppUI"] = CAppUI::init();
}
CAppUI::$instance =& $_SESSION["AppUI"];
CAppUI::$instance->session_name = $session_name;
if (!isset($_SESSION["locked"])) {
    $_SESSION["locked"] = false;
}
CAppUI::checkSessionUpdate();
 /**
  * Applies token's params to redirect the user
  * 
  * @return void
  */
 function applyParams()
 {
     // Save token expiration in the session
     CAppUI::$token_expiration = $this->getTokenExpiration();
     CAppUI::$token_restricted = $this->restricted == 1;
     CValue::setSessionAbs("token_expiration", CAppUI::$token_expiration);
     $params = $this->getParams();
     if (isset($params["tab"]) && empty($params["a"])) {
         $params["a"] = $params["tab"];
         unset($params["tab"]);
     }
     foreach ($params as $key => $value) {
         $_GET[$key] = $value;
         $_REQUEST[$key] = $value;
     }
 }