Beispiel #1
0
 private function __construct()
 {
     // Get/Set the user's timezone
     Utils::setTimezone();
     parent::setUri();
     //broken for the moment - auto install sql if necessary
     self::checkDB();
     // Check to see if we have a sufficient schema installed
     if (AdaptorMysql::query("SHOW TABLES LIKE '" . BLACKBIRD_TABLE_PREFIX . "info'")) {
         if ($q = AdaptorMysql::queryRow("SELECT * FROM " . BLACKBIRD_TABLE_PREFIX . "info WHERE name = 'schema_version'")) {
             if ($q['value'] < REQUIRED_SCHEMA_VERSION) {
                 die('You have an outdated SQL schema [' . $q['value'] . '], please run the update script for [' . REQUIRED_SCHEMA_VERSION . ']');
             }
         }
     } else {
         die('You have an outdated SQL schema, please run the update script for [' . REQUIRED_SCHEMA_VERSION . ']');
     }
     //custom session
     /*
     if(defined(BLACKBIRD_TABLE_PREFIX . 'SESSION_MANAGER')){
     	require_once(CMS_SESSION_MANAGER);
     }else{
     	require_once(INCLUDES.'SessionManager.class.php');
     }
     */
     self::setConfig();
     //create session
     require_once MODELS . 'UserModel.php';
     self::$session = new UserModel();
     //if we're not in the user controller trying to call login logout processlogin
     if (self::$requestA[0] == 'user' && (self::$requestA[1] == 'login' || self::$requestA[1] == 'logout' || self::$requestA[1] == 'loggedout' || self::$requestA[1] == 'processlogin' || self::$requestA[1] == 'processlogout' || self::$requestA[1] == 'reset' || self::$requestA[1] == 'processreset')) {
     } else {
         self::$session->checkSession();
     }
 }