config = $cfg['db']; ini_set('session.use_only_cookies',1); session_start(); // If we are in a protected page if(!isset($no_connect) || $no_connect != TRUE) { if(!$db->checkDB() && !function_exists('currently_installing')) { header("location: install.php"); exit; } if(!$db->connect()) { die('Connexion to DB failed. Check config.inc.php.'); } else { // Initiating default classes $xhtml = new xHTML(); $users = new Users($db); // Initiating custom classes // loadClasses = array('myClass','SecondClass'); if(isset($loadClasses) && is_array($loadClasses)) { foreach($loadClasses as $name) { ${$name} = new $name($db); } } $userData = $users->isLoggedReturnDatas(); if(isset($check_access) && $check_access > 0) { xHTML::noCache(); if($userData == FALSE) header("location: login.php"); if(!$users->haveAccess($check_access)) xHTML::Error("Vous n'avez pas le droit d'accéder à cette page.",'Access level too low: need '.$check_access.' and have only '.$userData['access'].'.',TRUE); } } } ?>