require_once $dirname . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'misc.functions.php'; require_once $dirname . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'module.functions.php'; debug_buffer('', 'Start of include'); # sanitize $_GET array_walk_recursive($_GET, 'sanitize_get_var'); #Make a new CMS object require cms_join_path($dirname, 'lib', 'classes', 'class.global.inc.php'); $gCms = new CmsObject(); if (isset($starttime)) { $gCms->variables['starttime'] = $starttime; } #Load the config file (or defaults if it doesn't exist) require cms_join_path($dirname, 'version.php'); require cms_join_path($dirname, 'lib', 'config.functions.php'); #Grab the current configuration $config =& $gCms->GetConfig(); #Adjust the url stuff if we're using HTTPS if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') { // adjust the root url if (!isset($config['ssl_url'])) { $config['ssl_url'] = str_replace('http://', 'https://', $config['root_url']); } $config['root_url'] = $config['ssl_url']; // adjust the uploads url if (!isset($config['ssl_uploads_url'])) { $config['ssl_uploads_url'] = str_replace('http://', 'https://', $config['ssl_uploads_url']); } $config['uploads_url'] = $config['ssl_uploads_url']; } else { if (startswith($config['root_url'], 'https://')) { // okay, not using SSL, but the root url is https...