Esempio n. 1
0
// 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();
if (!isset($_SESSION['browser'])) {
    /** Basic browser detection */
    $browser = array('version' => '0.0.0', 'majorver' => 0, 'minorver' => 0, 'build' => 0, 'name' => 'unknown', 'mobile' => false, 'deprecated' => false, 'useragent' => '', 'ie8' => false);
    $browsers = array('firefox', 'msie', 'opera', 'chrome', 'safari', 'mozilla', 'seamonkey', 'konqueror', 'netscape', 'gecko', 'navigator', 'mosaic', 'lynx', 'amaya', 'omniweb', 'avant', 'camino', 'flock', 'aol');
    $minimal_versions = CAppUI::conf("browser_compat");
    if (isset($_SERVER['HTTP_USER_AGENT'])) {
        $browser['useragent'] = $_SERVER['HTTP_USER_AGENT'];
        $user_agent = strtolower($browser['useragent']);