Exemple #1
0
require SERVER_ROOT . '/classes/regex.php';
require SERVER_ROOT . '/classes/util.php';
$Debug = new DEBUG();
$Debug->handle_errors();
$Debug->set_flag('Debug constructed');
$DB = new DB_MYSQL();
$Cache = new CACHE($MemcachedServers);
$Enc = new CRYPT();
// Autoload classes.
require SERVER_ROOT . '/classes/classloader.php';
// Note: G::initialize is called twice.
// This is necessary as the code inbetween (initialization of $LoggedUser) makes use of G::$DB and G::$Cache.
// TODO: remove one of the calls once we're moving everything into that class
G::initialize();
//Begin browser identification
$Browser = UserAgent::browser($_SERVER['HTTP_USER_AGENT']);
$OperatingSystem = UserAgent::operating_system($_SERVER['HTTP_USER_AGENT']);
//$Mobile = UserAgent::mobile($_SERVER['HTTP_USER_AGENT']);
$Mobile = in_array($_SERVER['HTTP_HOST'], array('m.' . NONSSL_SITE_URL, 'm.' . NONSSL_SITE_URL));
$Debug->set_flag('start user handling');
// Get classes
// TODO: Remove these globals, replace by calls into Users
list($Classes, $ClassLevels) = Users::get_classes();
//-- Load user information
// User info is broken up into many sections
// Heavy - Things that the site never has to look at if the user isn't logged in (as opposed to things like the class, donor status, etc)
// Light - Things that appear in format_user
// Stats - Uploaded and downloaded - can be updated by a script if you want super speed
// Session data - Information about the specific session
// Enabled - if the user's enabled or not
// Permissions