| 89 |
|
|
| 90 |
function get ($property) { |
function get ($property) { |
| 91 |
$config =& mamboCore::getMamboCore(); |
$config =& mamboCore::getMamboCore(); |
| 92 |
if ($property == 'mosConfig_absolute_path' AND realpath($config->mosConfig_absolute_path) === false) die ('Invalid program load path'); |
if ($property == 'mosConfig_absolute_path') { |
| 93 |
|
if (realpath($config->mosConfig_absolute_path) === false) die ('Invalid program load path'); |
| 94 |
|
else return $config->rootPath; |
| 95 |
|
} |
| 96 |
if (isset($config->$property)) return $config->$property; |
if (isset($config->$property)) return $config->$property; |
| 97 |
trigger_error("Invalid property ($property) requested from mamboCore"); |
trigger_error("Invalid property ($property) requested from mamboCore"); |
| 98 |
return null; |
return null; |
| 137 |
$subdir = substr(dirname(__FILE__), strlen($_SERVER['DOCUMENT_ROOT'])); |
$subdir = substr(dirname(__FILE__), strlen($_SERVER['DOCUMENT_ROOT'])); |
| 138 |
$subdir = str_replace('\\', '/', $subdir); |
$subdir = str_replace('\\', '/', $subdir); |
| 139 |
$this->mosConfig_live_site = 'http://'.$_SERVER['SERVER_NAME'].$subdir; |
$this->mosConfig_live_site = 'http://'.$_SERVER['SERVER_NAME'].$subdir; |
| 140 |
|
$this->mosConfig_absolute_path = $this->rootPath; |
| 141 |
preg_match_all('/\$this\-\>([A-Za-z_][A-Za-z0-9_]*)/', $code, $matches); |
preg_match_all('/\$this\-\>([A-Za-z_][A-Za-z0-9_]*)/', $code, $matches); |
| 142 |
foreach ($matches[1] as $match) $GLOBALS[$match] = $this->$match; |
foreach ($matches[1] as $match) $GLOBALS[$match] = $this->$match; |
| 143 |
if (!isset($this->mosConfig_register_globals)) { |
if (!isset($this->mosConfig_register_globals)) { |
| 271 |
$iFilter =& new InputFilter(); |
$iFilter =& new InputFilter(); |
| 272 |
$url = $iFilter->process( $url ); |
$url = $iFilter->process( $url ); |
| 273 |
$message = trim($iFilter->process($msg)); |
$message = trim($iFilter->process($msg)); |
| 274 |
if ($iFilter->badAttributeValue(array('href', $url))) $url = $GLOBALS['mosConfig_live_site']; |
if ($iFilter->badAttributeValue(array('href', $url))) $url = mamboCore::get('mosConfig_live_site'); |
| 275 |
if ($message) { |
if ($message) { |
| 276 |
if (strpos($url, '?')) $url .= '&mosmsg='.urlencode($message); |
if (strpos($url, '?')) $url .= '&mosmsg='.urlencode($message); |
| 277 |
else $url .= '?mosmsg='.urlencode($message); |
else $url .= '?mosmsg='.urlencode($message); |
| 410 |
require_once ($configuration->rootPath().'/includes/database.php'); |
require_once ($configuration->rootPath().'/includes/database.php'); |
| 411 |
|
|
| 412 |
/** |
/** |
| 413 |
|
* Mambo basic error object |
| 414 |
|
*/ |
| 415 |
|
define ('_MOS_ERROR_INFORM', 0); |
| 416 |
|
define ('_MOS_ERROR_WARN', 1); |
| 417 |
|
define ('_MOS_ERROR_SEVERE', 2); |
| 418 |
|
define ('_MOS_ERROR_FATAL', 3); |
| 419 |
|
|
| 420 |
|
class mosError { |
| 421 |
|
var $text = ''; |
| 422 |
|
var $level = 0; |
| 423 |
|
|
| 424 |
|
function mosError ($text='', $level=_MOS_ERROR_INFORM) { |
| 425 |
|
$this->text = $text; |
| 426 |
|
$this->level = $level; |
| 427 |
|
} |
| 428 |
|
} |
| 429 |
|
|
| 430 |
|
/** |
| 431 |
|
* Mambo group of errors for some particular operation |
| 432 |
|
*/ |
| 433 |
|
class mosErrorSet { |
| 434 |
|
var $errors = array(); |
| 435 |
|
var $maxlevel = 0; |
| 436 |
|
|
| 437 |
|
// Parameter is an error object |
| 438 |
|
function addError ($error) { |
| 439 |
|
$this->errors[] = $error; |
| 440 |
|
if ($error->level > $this->maxlevel) $this->maxlevel = $error->level; |
| 441 |
|
} |
| 442 |
|
|
| 443 |
|
function addErrorDetails ($text='', $level=_MOS_ERROR_INFORM) { |
| 444 |
|
$error = new mosError($text, $level); |
| 445 |
|
$this->addError($error); |
| 446 |
|
} |
| 447 |
|
|
| 448 |
|
function &getErrors () { |
| 449 |
|
return $this->errors; |
| 450 |
|
} |
| 451 |
|
|
| 452 |
|
function getMaxLevel () { |
| 453 |
|
return $this->maxlevel; |
| 454 |
|
} |
| 455 |
|
|
| 456 |
|
function getCount () { |
| 457 |
|
return count($this->errors); |
| 458 |
|
} |
| 459 |
|
|
| 460 |
|
function mergeAnother ($errorset) { |
| 461 |
|
$this->errors = array_merge($this->errors, $errorset->errors); |
| 462 |
|
} |
| 463 |
|
|
| 464 |
|
} |
| 465 |
|
|
| 466 |
|
/** |
| 467 |
* Sorts an Array of objects |
* Sorts an Array of objects |
| 468 |
*/ |
*/ |
| 469 |
class mosObjectSorter { |
class mosObjectSorter { |