Will NOT report uninitialized variables * set_magic_quotes_runtime ( ) -> Disable magic_quotes_runtime * ini_set ( 'display_errors' ) - Set this to 1 if you wish to see verbose errors * **/ error_reporting( E_ERROR | E_WARNING | E_PARSE ); set_magic_quotes_runtime(0); ini_set('display_errors',1); /** * * Include bootstrap runtime script to clean up session vars and * run some other basic checks for cross PHP compatibility and * include some required files * **/ require (sprintf('%s/includes/bootstrap.%s',$root,$ext)); require (sprintf('%s/includes/config.%s',$root,$ext)); require (sprintf('%s/includes/constants.%s',$root,$ext)); require (sprintf('%s/includes/class/session.%s',$root,$ext)); require (sprintf('%s/includes/functions/global_tools.%s',$root,$ext)); require (sprintf('%s/includes/i18n.%s',$root,$ext)); require (sprintf('%s/includes/dbi/index.%s',$root,$ext)); unset($database['password']); /** * * Grab general information from config table * Declare $config as an array * **/ global $config; $config = array(); $sql = sprintf("SELECT config_name, config_value FROM %s",CONFIG_TABLE); if ( !($result = $db->sql_query($sql)) ) { report_error(CRITICAL_ERROR,sprintf('Unable to query table: %s',CONFIG_TABLE),$sql,__FILE__,__LINE__); } while ( $row = $db->sql_fetchobj($result) ) { $config[$row->config_name] = $row->config_value; } $db->sql_freeresult($result); /** * * Include LocalSettings.php * * Inherit database information,defined inherited DB * names from LocalSettings.php * **/ require (sprintf('%s/LocalSettings.%s',$root,$ext)); foreach ( $config['dbinherit'] as $key => $val ) { if ( !empty($key) && !empty($val) ) { if ( preg_match('/^[A-Z,_]+_TABLE$/',$key) ) { define($key,$database['prefix'].$val); } else { define($key,$val); } } else { report_error(CRITICAL_ERROR,'Unable to inherit database table information.',NULL,__FILE__,__LINE__); } } if ( empty($config['apache']['uid']) || empty($config['apache']['gid']) ) { report_error(CRITICAL_ERROR,'Please set your Apache UserID and GroupID.',NULL,__FILE__,__LINE__); } /** * * Set some values, do some "magic" with some vars... ooooo.. ;-) * Reset $root path, Include class files.. * **/ require (sprintf('%s/includes/classes.%s',$root,$ext)); $root = vma_realpath($root); $config['textdomain'] = 'vmailadmin'; $config['i18n'] = sprintf('%s/i18n',$root); $config['perl_scripts'] = sprintf('%s/includes/bin',$root); $config['cache_directory'] = sprintf('%s/%s',$root,$config['cache_directory']); $config['current_time'] = time(); /** * * Initialize user session * **/ global $user_ip,$nav_link; $config['items_per_page'] = $user->data['items_per_page'] ? (int)$user->data['items_per_page'] : (int)$config['items_per_page']; $user_ip = encode_ip($client_ip); $user = new user(); /** * * If root user doesn't exist, we assume a new install * We include this file to make this check and continue * accordingly * **/ if ( !get_count(USERS_TABLE,"user_id",sprintf("WHERE user_level = '%d'",ROOT)) ) { define('SETUP_HELPER',TRUE); $user->session_begin(); $user->setup(); require (sprintf('%s/includes/functions/setup_tools.%s',$root,$ext)); } ////////////////////////////////////////////////////////////////////////////////////////////////////// // // To be executed once domain level black/white listing has been implemented AND ONLY after // definition in constants.php has been changed to reflect this change. // // DO NOT TOUCH! DO NOT UNCOMMENT! DO NOT EXECUTE! YOU HAVE BEEN WARNED! // // $sql = sprintf("UPDATE %s SET username = '%s' WHERE user_id = '%d'",USERPREF_TABLE,GLOBAL_USER,GLOBAL_USERID); // $db->sql_query($sql); // ////////////////////////////////////////////////////////////////////////////////////////////////////// ?>