} $GLOBALS['user']->update_last_seen(); } } else { if (isset($_REQUEST['sid'])) { session_name(AmpConfig::get('session_name')); session_id(scrub_in($_REQUEST['sid'])); session_start(); $GLOBALS['user'] = new User($_SESSION['userdata']['uid']); } else { $GLOBALS['user'] = new User(); } } // If NO_SESSION passed // Load the Preferences from the database Preference::init(); if (session_id()) { Session::extend(session_id()); // We only need to create the tmp playlist if we have a session $GLOBALS['user']->load_playlist(); } /* Add in some variables for ajax done here because we need the user */ AmpConfig::set('ajax_url', AmpConfig::get('web_path') . '/server/ajax.server.php', true); AmpConfig::set('ajax_server', AmpConfig::get('web_path') . '/server', true); // Load gettext mojo load_gettext(); /* Set CHARSET */ header("Content-Type: text/html; charset=" . AmpConfig::get('site_charset')); /* Clean up a bit */ unset($array); unset($results);