Example #1
0
require __DIR__ . "/includes/session.php";
CMbPerformance::mark("session");
// Start chrono (after session_start as it may be locked by another request)
CApp::$chrono = new Chronometer();
CApp::$chrono->main = true;
CApp::$chrono->start();
$do_login = false;
// Load default preferences if not logged in
if (!CAppUI::$instance->user_id) {
    CAppUI::loadPrefs();
    try {
        CApp::notify("UserAuthentication", true);
    } catch (CUserAuthenticationFailure $e) {
        CApp::rip();
    } catch (CUserAuthenticationSuccess $e) {
        CAppUI::$auth_info = $e;
        $do_login = true;
    }
}
// Update session lifetime
CSessionHandler::setUserDefinedLifetime();
/*
try {
  include __DIR__."/classes/CAuth.class.php";
  //CAuth::login();
}
catch (AuthenticationFailedException $e) {
  CAppUI::setMsg($e->getMessage());
}
*/
// If the user uses a token, his session should not be reset, but only redirected