| 218 |
function mamboCore () { |
function mamboCore () { |
| 219 |
global $adminside; |
global $adminside; |
| 220 |
$this->init_errorlevel = error_reporting(0); |
$this->init_errorlevel = error_reporting(0); |
| 221 |
$this->rootPath = str_replace('\\', '/', realpath(str_replace('includes', '', dirname(__FILE__)))); |
//$this->rootPath = str_replace('\\', '/', realpath(str_replace('includes', '', dirname(__FILE__)))); |
| 222 |
|
$this->rootPath = str_replace('\\', '/',str_replace('/includes', '', dirname(__FILE__))); |
| 223 |
$this->checkConfig(); |
$this->checkConfig(); |
| 224 |
$this->Itemid = mosGetParam($_REQUEST, 'Itemid', 0); |
$this->Itemid = mosGetParam($_REQUEST, 'Itemid', 0); |
| 225 |
$this->getConfig(); |
$this->getConfig(); |
| 246 |
* @return unknown |
* @return unknown |
| 247 |
*/ |
*/ |
| 248 |
function rootPath () { |
function rootPath () { |
| 249 |
if (realpath($this->rootPath) === false) die ('Invalid program load path'); |
//if (realpath($this->rootPath) === false) die ('Invalid program load path'); |
| 250 |
|
if (file_exists($this->rootPath) === false) die ('Invalid program load path'); |
| 251 |
return $this->rootPath; |
return $this->rootPath; |
| 252 |
} |
} |
| 253 |
|
|
| 260 |
function get ($property) { |
function get ($property) { |
| 261 |
$config =& mamboCore::getMamboCore(); |
$config =& mamboCore::getMamboCore(); |
| 262 |
if ($property == 'mosConfig_absolute_path') { |
if ($property == 'mosConfig_absolute_path') { |
| 263 |
if (realpath($config->mosConfig_absolute_path) === false) die ('Invalid program load path'); |
//if (realpath($config->mosConfig_absolute_path) === false) die ('Invalid program load path'); |
| 264 |
|
if (file_exists($config->mosConfig_absolute_path) === false) die ('Invalid program load path'); |
| 265 |
else return $config->rootPath; |
else return $config->rootPath; |
| 266 |
} |
} |
| 267 |
if (isset($config->$property)) return $config->$property; |
if (isset($config->$property)) return $config->$property; |
| 343 |
$mamboroot = str_replace('\\', '/', rtrim($this->rootPath, '\/')); |
$mamboroot = str_replace('\\', '/', rtrim($this->rootPath, '\/')); |
| 344 |
$this->subdirectory = substr($mamboroot, strlen($docroot)); |
$this->subdirectory = substr($mamboroot, strlen($docroot)); |
| 345 |
|
|
|
|
|
| 346 |
$scheme = isset($_SERVER['HTTP_SCHEME']) ? $_SERVER['HTTP_SCHEME'] : ((isset($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS'] != 'off')) ? 'https' : 'http'); |
$scheme = isset($_SERVER['HTTP_SCHEME']) ? $_SERVER['HTTP_SCHEME'] : ((isset($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS'] != 'off')) ? 'https' : 'http'); |
| 347 |
if (isset($_SERVER['HTTP_HOST'])) { |
if (isset($_SERVER['HTTP_HOST'])) { |
| 348 |
$withport = explode(':', $_SERVER['HTTP_HOST']); |
$withport = explode(':', $_SERVER['HTTP_HOST']); |