| 2 |
/** |
/** |
| 3 |
* @package Mambo |
* @package Mambo |
| 4 |
* @author Mambo Foundation Inc see README.php |
* @author Mambo Foundation Inc see README.php |
| 5 |
* @copyright Mambo Foundation Inc. |
* @copyright (C) 2000 - 2009 Mambo Foundation Inc. |
| 6 |
* See COPYRIGHT.php for copyright notices and details. |
* See COPYRIGHT.php for copyright notices and details. |
| 7 |
* @license GNU/GPL Version 2, see LICENSE.php |
* @license GNU/GPL Version 2, see LICENSE.php |
| 8 |
|
* |
| 9 |
|
* Redistributions of files must retain the above copyright notice. |
| 10 |
|
* |
| 11 |
* Mambo is free software; you can redistribute it and/or |
* Mambo is free software; you can redistribute it and/or |
| 12 |
* modify it under the terms of the GNU General Public License |
* modify it under the terms of the GNU General Public License |
| 13 |
* as published by the Free Software Foundation; version 2 of the License. |
* as published by the Free Software Foundation; version 2 of the License. |
| 414 |
} |
} |
| 415 |
} |
} |
| 416 |
|
|
| 417 |
/** |
function loadLanguage(){ |
|
* Enter description here... |
|
|
* |
|
|
*/ |
|
|
function fixLanguage () { |
|
|
require_once($this->mosConfig_absolute_path.'/includes/phpgettext/phpgettext.class.php'); |
|
|
require_once($this->mosConfig_absolute_path.'/includes/phpgettext/error.php'); |
|
|
require_once($this->mosConfig_absolute_path.'/includes/mambofunc.php'); |
|
|
require_once($this->mosConfig_absolute_path.'/includes/mambolanguage.class.php'); |
|
| 418 |
if (!mosGetParam($_REQUEST, 'lang')); |
if (!mosGetParam($_REQUEST, 'lang')); |
| 419 |
else $this->mosConfig_locale = mosGetParam($_REQUEST, 'lang', $this->mosConfig_locale); |
else $this->mosConfig_locale = mosGetParam($_REQUEST, 'lang', $this->mosConfig_locale); |
| 420 |
$language =& new mamboLanguage($this->mosConfig_locale, $this->rootPath.'/language/'); |
$language =& new mamboLanguage($this->mosConfig_locale, $this->rootPath.'/language/'); |
| 436 |
if (file_exists($language_file)) require_once ($language_file); |
if (file_exists($language_file)) require_once ($language_file); |
| 437 |
else require_once ("$this->mosConfig_absolute_path/language/english.php"); |
else require_once ("$this->mosConfig_absolute_path/language/english.php"); |
| 438 |
################################### |
################################### |
| 439 |
|
} |
| 440 |
|
/** |
| 441 |
|
* Enter description here... |
| 442 |
|
* |
| 443 |
|
*/ |
| 444 |
|
function fixLanguage () { |
| 445 |
|
require_once($this->mosConfig_absolute_path.'/includes/phpgettext/phpgettext.class.php'); |
| 446 |
|
require_once($this->mosConfig_absolute_path.'/includes/phpgettext/error.php'); |
| 447 |
|
require_once($this->mosConfig_absolute_path.'/includes/mambofunc.php'); |
| 448 |
|
require_once($this->mosConfig_absolute_path.'/includes/mambolanguage.class.php'); |
| 449 |
} |
} |
| 450 |
|
|
| 451 |
/** |
/** |
| 540 |
if (strpos($url, '?')) $url .= '&mosmsg='.urlencode($message); |
if (strpos($url, '?')) $url .= '&mosmsg='.urlencode($message); |
| 541 |
else $url .= '?mosmsg='.urlencode($message); |
else $url .= '?mosmsg='.urlencode($message); |
| 542 |
} |
} |
| 543 |
|
$url = preg_replace("/[\n]|[\r]/",'',$url); |
| 544 |
if (headers_sent()) echo "<script>document.location.href='$url';</script>\n"; |
if (headers_sent()) echo "<script>document.location.href='$url';</script>\n"; |
| 545 |
else { |
else { |
| 546 |
@ob_end_clean(); // clear output buffer |
@ob_end_clean(); // clear output buffer |
| 1396 |
$checker = explode(',', $types); |
$checker = explode(',', $types); |
| 1397 |
$result = null; |
$result = null; |
| 1398 |
foreach ($this->_menus as $menu) { |
foreach ($this->_menus as $menu) { |
| 1399 |
if (in_array($menu->menutype, $checker)) $result[] = $menu; |
if (in_array($menu->type, $checker)) $result[] = $menu; |
| 1400 |
} |
} |
| 1401 |
return $result; |
return $result; |
| 1402 |
} |
} |
| 2437 |
*/ |
*/ |
| 2438 |
function getUserStateFromRequest( $var_name, $req_name, $var_default=null ) { |
function getUserStateFromRequest( $var_name, $req_name, $var_default=null ) { |
| 2439 |
if (is_array($this->_userstate)) { |
if (is_array($this->_userstate)) { |
| 2440 |
if (isset($_REQUEST[$req_name])) $this->setUserState($var_name, $_REQUEST[$req_name]); |
if (isset($_REQUEST[$req_name])) $this->setUserState($var_name, preg_replace('/[^\w\s\.,-_\(\)]/','',mosGetParam($_REQUEST,$req_name))); |
| 2441 |
else if (isset($var_default) AND !isset($this->_userstate[$var_name])) $this->setUserState($var_name, $var_default); |
else if (isset($var_default) AND !isset($this->_userstate[$var_name])) $this->setUserState($var_name, $var_default); |
| 2442 |
return $this->_userstate[$var_name]; |
return $this->_userstate[$var_name]; |
| 2443 |
} else { |
} else { |
| 2491 |
if ($mos_change_template) { |
if ($mos_change_template) { |
| 2492 |
// check that template exists in case it was deleted |
// check that template exists in case it was deleted |
| 2493 |
$path = mamboCore::get('mosConfig_absolute_path')."/templates/$mos_change_template/index.php"; |
$path = mamboCore::get('mosConfig_absolute_path')."/templates/$mos_change_template/index.php"; |
| 2494 |
if (strpos($mos_change_template,'..') == false AND strpos($mos_change_template,':') == false AND file_exists($path)) { |
if (strpos($mos_change_template,'..') === false AND strpos($mos_change_template,':') === false AND file_exists($path)) { |
| 2495 |
$lifetime = 60*10; |
$lifetime = 60*10; |
| 2496 |
$cur_template = $mos_change_template; |
$cur_template = $mos_change_template; |
| 2497 |
setcookie( "mos_user_template", "$mos_change_template", time()+$lifetime); |
setcookie( "mos_user_template", "$mos_change_template", time()+$lifetime); |
| 2790 |
if (!$task) die('Illegal task for mainframe validFormId in core.classes.php'); |
if (!$task) die('Illegal task for mainframe validFormId in core.classes.php'); |
| 2791 |
if (!is_object($my)) die('Illegal user object for mainframe validFormId in core.classes.php'); |
if (!is_object($my)) die('Illegal user object for mainframe validFormId in core.classes.php'); |
| 2792 |
if (!isset($_REQUEST['f'])) die('Missing hash for mainframe validFormId in core.classes.php'); |
if (!isset($_REQUEST['f'])) die('Missing hash for mainframe validFormId in core.classes.php'); |
| 2793 |
|
mos_session_start(); |
| 2794 |
if (!isset($_SESSION['mosfid'])) return false; |
if (!isset($_SESSION['mosfid'])) return false; |
| 2795 |
$valid = $_SESSION['mosfid'] == md5($_REQUEST['f'].$option.$task.$my->id.mamboCore::get('mosConfig_secret')); |
$valid = $_SESSION['mosfid'] == md5($_REQUEST['f'].$option.$task.$my->id.mamboCore::get('mosConfig_secret')); |
| 2796 |
unset($_SESSION['mosfid']); |
unset($_SESSION['mosfid']); |