| 1 |
<?php |
<?php |
| 2 |
/** |
/** |
| 3 |
* @package Mambo Open Source |
* @package Mambo |
| 4 |
* @copyright (C) 2005 - 2007 Mambo Foundation Inc. |
* @author Mambo Foundation Inc see README.php |
| 5 |
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL |
* @copyright Mambo Foundation Inc. |
| 6 |
* |
* See COPYRIGHT.php for copyright notices and details. |
| 7 |
* Mambo was originally developed by Miro (www.miro.com.au) in 2000. Miro assigned the copyright in Mambo to The Mambo Foundation in 2005 to ensure |
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see |
| 8 |
* that Mambo remained free Open Source software owned and managed by the community. |
* LICENSE.php |
| 9 |
* Mambo is Free Software |
* Mambo is free software; you can redistribute it and/or |
| 10 |
|
* modify it under the terms of the GNU General Public License |
| 11 |
|
* as published by the Free Software Foundation; version 2 of the |
| 12 |
|
* License. |
| 13 |
*/ |
*/ |
| 14 |
|
|
| 15 |
/** |
/** |
| 339 |
eval($code); |
eval($code); |
| 340 |
|
|
| 341 |
|
|
| 342 |
if (isset($_SERVER['DOCUMENT_ROOT']) AND strlen($_SERVER['DOCUMENT_ROOT'])) { |
/*if (isset($_SERVER['DOCUMENT_ROOT']) AND strlen($_SERVER['DOCUMENT_ROOT'])) { |
| 343 |
$docroot = str_replace('\\', '/', str_replace('\\\\', '\\', $_SERVER['DOCUMENT_ROOT'])); |
$docroot = str_replace('\\', '/', str_replace('\\\\', '\\', $_SERVER['DOCUMENT_ROOT'])); |
| 344 |
} |
} |
| 345 |
else { |
else {*/ |
| 346 |
// Find information about where execution started |
// Find information about where execution started |
| 347 |
$origin = array_pop(debug_backtrace()); |
$origin = array_pop(debug_backtrace()); |
| 348 |
// Find the PHP script at the start, with a fix for Windows slashes |
// Find the PHP script at the start, with a fix for Windows slashes |
| 349 |
$absolutepath = str_replace('\\', '/', $origin['file']); |
$absolutepath = str_replace('\\', '/', $origin['file']); |
| 350 |
$localpath = $_SERVER['PHP_SELF']; |
$localpath = $_SERVER['PHP_SELF']; |
| 351 |
$docroot = substr($absolutepath,0,strpos($absolutepath,$localpath)); |
$docroot = substr($absolutepath,0,strpos($absolutepath,$localpath)); |
| 352 |
} |
/*}*/ |
| 353 |
$mamboroot = str_replace('\\', '/', rtrim($this->rootPath, '\/')); |
$mamboroot = str_replace('\\', '/', rtrim($this->rootPath, '\/')); |
| 354 |
$this->subdirectory = substr($mamboroot, strlen($docroot)); |
$this->subdirectory = substr($mamboroot, strlen($docroot)); |
| 355 |
|
|
| 398 |
* @param unknown_type $database |
* @param unknown_type $database |
| 399 |
*/ |
*/ |
| 400 |
function offlineCheck (&$user, &$database) { |
function offlineCheck (&$user, &$database) { |
| 401 |
if ($this->mosConfig_offline OR file_exists($this->rootPath.'/installation/index.php')) { |
global $adminside; |
| 402 |
|
if (($this->mosConfig_offline && !$adminside) OR file_exists($this->rootPath.'/installation/index.php')) { |
| 403 |
require_once($this->rootPath().'/administrator/includes/admin.php'); |
require_once($this->rootPath().'/administrator/includes/admin.php'); |
| 404 |
session_name(md5($this->mosConfig_live_site)); |
session_name(md5($this->mosConfig_live_site)); |
| 405 |
session_start(); |
session_start(); |
| 421 |
require_once($this->mosConfig_absolute_path.'/includes/phpgettext/error.php'); |
require_once($this->mosConfig_absolute_path.'/includes/phpgettext/error.php'); |
| 422 |
require_once($this->mosConfig_absolute_path.'/includes/mambofunc.php'); |
require_once($this->mosConfig_absolute_path.'/includes/mambofunc.php'); |
| 423 |
require_once($this->mosConfig_absolute_path.'/includes/mambolanguage.class.php'); |
require_once($this->mosConfig_absolute_path.'/includes/mambolanguage.class.php'); |
| 424 |
$this->mosConfig_locale = mosGetParam($_POST, 'lang', $this->mosConfig_locale); |
$this->mosConfig_locale = mosGetParam($_REQUEST, 'lang', $this->mosConfig_locale); |
| 425 |
|
|
| 426 |
$language =& new mamboLanguage($this->mosConfig_locale, $this->rootPath.'/language/'); |
$language =& new mamboLanguage($this->mosConfig_locale, $this->rootPath.'/language/'); |
| 427 |
$languages = $language->getLanguages(); |
$languages = $language->getLanguages(); |
| 430 |
$this->mosConfig_lang = $language->get('lang'); |
$this->mosConfig_lang = $language->get('lang'); |
| 431 |
$this->current_language = $language; |
$this->current_language = $language; |
| 432 |
if (!defined('_ISO')) DEFINE('_ISO','charset='.$charset); |
if (!defined('_ISO')) DEFINE('_ISO','charset='.$charset); |
| 433 |
|
header('Content-type: text/html; '._ISO); |
| 434 |
if (!defined('_DATE_FORMAT_LC')) DEFINE('_DATE_FORMAT_LC', $dateformat); //Uses PHP's strftime Command Format |
if (!defined('_DATE_FORMAT_LC')) DEFINE('_DATE_FORMAT_LC', $dateformat); //Uses PHP's strftime Command Format |
| 435 |
if (!defined('_DATE_FORMAT_LC2')) DEFINE('_DATE_FORMAT_LC2', $dateformat); |
if (!defined('_DATE_FORMAT_LC2')) DEFINE('_DATE_FORMAT_LC2', $dateformat); |
| 436 |
|
|
| 1971 |
if (isset($result[0])) return $result[0]; |
if (isset($result[0])) return $result[0]; |
| 1972 |
return null; |
return null; |
| 1973 |
} |
} |
| 1974 |
|
|
| 1975 |
|
function getBot($element, $folder) { |
| 1976 |
|
$returnBot = ''; |
| 1977 |
|
foreach ($this->_bots as $i=>$bot) { |
| 1978 |
|
if ($bot->folder == $folder && $bot->element == $element){ |
| 1979 |
|
$returnBot = $bot; |
| 1980 |
|
break; |
| 1981 |
|
} |
| 1982 |
|
} |
| 1983 |
|
return $returnBot; |
| 1984 |
|
} |
| 1985 |
} |
} |
| 1986 |
|
|
| 1987 |
/** |
/** |
| 2059 |
*/ |
*/ |
| 2060 |
function check() { |
function check() { |
| 2061 |
Global $mosConfig_absolute_path; |
Global $mosConfig_absolute_path; |
| 2062 |
include $mosConfig_absolute_path . ('/language/english.php'); |
//include $mosConfig_absolute_path . ('/language/english.php'); |
| 2063 |
$this->_error = ''; |
$this->_error = ''; |
| 2064 |
if ($this->name == '') $this->_error = _REGWARN_NAME; |
if ($this->name == '') $this->_error = _REGWARN_NAME; |
| 2065 |
elseif ($this->username == '') $this->_error = _REGWARN_UNAME; |
elseif ($this->username == '') $this->_error = _REGWARN_UNAME; |