| 4 |
* @author Mambo Foundation Inc see README.php |
* @author Mambo Foundation Inc see README.php |
| 5 |
* @copyright Mambo Foundation Inc. |
* @copyright Mambo Foundation Inc. |
| 6 |
* See COPYRIGHT.php for copyright notices and details. |
* See COPYRIGHT.php for copyright notices and details. |
| 7 |
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see |
* @license GNU/GPL Version 2, see LICENSE.php |
|
* LICENSE.php |
|
| 8 |
* Mambo is free software; you can redistribute it and/or |
* Mambo is free software; you can redistribute it and/or |
| 9 |
* modify it under the terms of the GNU General Public License |
* modify it under the terms of the GNU General Public License |
| 10 |
* as published by the Free Software Foundation; version 2 of the |
* as published by the Free Software Foundation; version 2 of the License. |
|
* License. |
|
| 11 |
*/ |
*/ |
| 12 |
|
|
| 13 |
/** |
/** |
| 229 |
//$this->rootPath = str_replace('\\', '/', realpath(str_replace('includes', '', dirname(__FILE__)))); |
//$this->rootPath = str_replace('\\', '/', realpath(str_replace('includes', '', dirname(__FILE__)))); |
| 230 |
$this->rootPath = str_replace('\\', '/',str_replace('includes', '', dirname(__FILE__))); |
$this->rootPath = str_replace('\\', '/',str_replace('includes', '', dirname(__FILE__))); |
| 231 |
$this->checkConfig(); |
$this->checkConfig(); |
| 232 |
$this->Itemid = mosGetParam($_REQUEST, 'Itemid', 0); |
$this->Itemid = (int)mosGetParam($_REQUEST, 'Itemid', 0); |
| 233 |
$this->getConfig(); |
$this->getConfig(); |
| 234 |
$this->fixLanguage(); |
$this->fixLanguage(); |
| 235 |
@set_magic_quotes_runtime( 0 ); |
@set_magic_quotes_runtime( 0 ); |
| 336 |
fclose($f); |
fclose($f); |
| 337 |
eval($code); |
eval($code); |
| 338 |
|
|
|
|
|
|
/*if (isset($_SERVER['DOCUMENT_ROOT']) AND strlen($_SERVER['DOCUMENT_ROOT'])) { |
|
|
$docroot = str_replace('\\', '/', str_replace('\\\\', '\\', $_SERVER['DOCUMENT_ROOT'])); |
|
|
} |
|
|
else {*/ |
|
|
// Find information about where execution started |
|
| 339 |
$origin = array_pop(debug_backtrace()); |
$origin = array_pop(debug_backtrace()); |
| 340 |
// 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 |
| 341 |
$absolutepath = str_replace('\\', '/', $origin['file']); |
$absolutepath = str_replace('\\', '/', $origin['file']); |
| 342 |
$localpath = $_SERVER['PHP_SELF']; |
$localpath = $_SERVER['PHP_SELF']; |
| 343 |
|
$userdir= ''; |
| 344 |
|
if (strpos($localpath,'~') !== false){ |
| 345 |
|
$userdir = substr($localpath, 0, strpos(substr($localpath,1),'/')+1); |
| 346 |
|
$localpath = substr($localpath,strpos(substr($localpath,1),'/')+1); |
| 347 |
|
} |
| 348 |
$docroot = substr($absolutepath,0,strpos($absolutepath,$localpath)); |
$docroot = substr($absolutepath,0,strpos($absolutepath,$localpath)); |
|
/*}*/ |
|
| 349 |
$mamboroot = str_replace('\\', '/', rtrim($this->rootPath, '\/')); |
$mamboroot = str_replace('\\', '/', rtrim($this->rootPath, '\/')); |
| 350 |
$this->subdirectory = substr($mamboroot, strlen($docroot)); |
$this->subdirectory = $userdir . substr($mamboroot, strlen($docroot)); |
| 351 |
|
|
| 352 |
$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'); |
| 353 |
if (isset($_SERVER['HTTP_HOST'])) { |
if (isset($_SERVER['HTTP_HOST'])) { |
| 397 |
global $adminside; |
global $adminside; |
| 398 |
if (($this->mosConfig_offline && !$adminside) OR file_exists($this->rootPath.'/installation/index.php')) { |
if (($this->mosConfig_offline && !$adminside) OR file_exists($this->rootPath.'/installation/index.php')) { |
| 399 |
require_once($this->rootPath().'/administrator/includes/admin.php'); |
require_once($this->rootPath().'/administrator/includes/admin.php'); |
|
session_name(md5($this->mosConfig_live_site)); |
|
| 400 |
session_start(); |
session_start(); |
| 401 |
$session =& mosSession::getCurrent(); |
$session =& mosSession::getCurrent(); |
| 402 |
|
if (!isset($_SESSION['initiated'])) { |
| 403 |
|
session_regenerate_id(true); |
| 404 |
|
$_SESSION['initiated'] = true; |
| 405 |
|
} |
| 406 |
$my =& new mosUser(); |
$my =& new mosUser(); |
| 407 |
$my->getSessionData(); |
$my->getSessionData(); |
| 408 |
if (mosSession::validate($my)) return; |
if (mosSession::validate($my)) return; |
| 411 |
} |
} |
| 412 |
} |
} |
| 413 |
|
|
| 414 |
/** |
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'); |
|
| 415 |
if (!mosGetParam($_REQUEST, 'lang')); |
if (!mosGetParam($_REQUEST, 'lang')); |
| 416 |
else $this->mosConfig_locale = mosGetParam($_REQUEST, 'lang', $this->mosConfig_locale); |
else $this->mosConfig_locale = mosGetParam($_REQUEST, 'lang', $this->mosConfig_locale); |
| 417 |
$language =& new mamboLanguage($this->mosConfig_locale, $this->rootPath.'/language/'); |
$language =& new mamboLanguage($this->mosConfig_locale, $this->rootPath.'/language/'); |
| 433 |
if (file_exists($language_file)) require_once ($language_file); |
if (file_exists($language_file)) require_once ($language_file); |
| 434 |
else require_once ("$this->mosConfig_absolute_path/language/english.php"); |
else require_once ("$this->mosConfig_absolute_path/language/english.php"); |
| 435 |
################################### |
################################### |
| 436 |
|
} |
| 437 |
|
/** |
| 438 |
|
* Enter description here... |
| 439 |
|
* |
| 440 |
|
*/ |
| 441 |
|
function fixLanguage () { |
| 442 |
|
require_once($this->mosConfig_absolute_path.'/includes/phpgettext/phpgettext.class.php'); |
| 443 |
|
require_once($this->mosConfig_absolute_path.'/includes/phpgettext/error.php'); |
| 444 |
|
require_once($this->mosConfig_absolute_path.'/includes/mambofunc.php'); |
| 445 |
|
require_once($this->mosConfig_absolute_path.'/includes/mambolanguage.class.php'); |
| 446 |
} |
} |
| 447 |
|
|
| 448 |
/** |
/** |
| 479 |
* @return unknown |
* @return unknown |
| 480 |
*/ |
*/ |
| 481 |
function determineOptionAndItemid () { |
function determineOptionAndItemid () { |
| 482 |
$this->Itemid = mosGetParam($_REQUEST, 'Itemid', 0); |
$this->Itemid = (int)mosGetParam($_REQUEST, 'Itemid', 0); |
| 483 |
if ($option = strtolower(mosGetParam($_REQUEST, 'option'))); |
if ($option = strtolower(mosGetParam($_REQUEST, 'option'))); |
| 484 |
else { |
else { |
| 485 |
$menuhandler =& mosMenuHandler::getInstance(); |
$menuhandler =& mosMenuHandler::getInstance(); |
| 486 |
$menus =& $menuhandler->getByParentOrder($this->Itemid, 'mainmenu'); |
$menus =& $menuhandler->getByParentOrder($this->Itemid, 'mainmenu'); |
| 487 |
|
if (count($menus)) { |
| 488 |
$this->Itemid = $menus[0]->id; |
$this->Itemid = $menus[0]->id; |
| 489 |
$_REQUEST['Itemid'] = $this->Itemid; |
$_REQUEST['Itemid'] = $this->Itemid; |
| 490 |
$link = $menus[0]->link; |
$link = $menus[0]->link; |
| 496 |
if (isset($temp['option'])) $option = $temp['option']; |
if (isset($temp['option'])) $option = $temp['option']; |
| 497 |
else return ''; |
else return ''; |
| 498 |
} |
} |
| 499 |
|
} |
| 500 |
/** patch to lessen the impact on templates */ |
/** patch to lessen the impact on templates */ |
| 501 |
if ($option == 'search') $option = 'com_search'; |
if ($option == 'search') $option = 'com_search'; |
| 502 |
// checking if we can find the Itemid thru the component |
// checking if we can find the Itemid thru the component |
| 504 |
if ( $option == 'com_content') { |
if ( $option == 'com_content') { |
| 505 |
require_once($this->rootPath().'/components/com_content/content.class.php'); |
require_once($this->rootPath().'/components/com_content/content.class.php'); |
| 506 |
$handler =& contentHandler::getInstance(); |
$handler =& contentHandler::getInstance(); |
| 507 |
$this->Itemid = $handler->getItemid(mosGetParam($_REQUEST, 'id', 0 )); |
$this->Itemid = (int)$handler->getItemid(mosGetParam($_REQUEST, 'id', 0 )); |
| 508 |
$_REQUEST['Itemid'] = $this->Itemid; |
$_REQUEST['Itemid'] = $this->Itemid; |
| 509 |
} |
} |
| 510 |
else { |
else { |
| 516 |
} |
} |
| 517 |
} |
} |
| 518 |
} |
} |
| 519 |
return $option; |
return trim(htmlspecialchars($option)); |
| 520 |
} |
} |
| 521 |
|
|
| 522 |
/** |
/** |
| 537 |
if (strpos($url, '?')) $url .= '&mosmsg='.urlencode($message); |
if (strpos($url, '?')) $url .= '&mosmsg='.urlencode($message); |
| 538 |
else $url .= '?mosmsg='.urlencode($message); |
else $url .= '?mosmsg='.urlencode($message); |
| 539 |
} |
} |
| 540 |
|
$url = preg_replace("/[\n]|[\r]/",'',$url); |
| 541 |
if (headers_sent()) echo "<script>document.location.href='$url';</script>\n"; |
if (headers_sent()) echo "<script>document.location.href='$url';</script>\n"; |
| 542 |
else { |
else { |
| 543 |
@ob_end_clean(); // clear output buffer |
@ob_end_clean(); // clear output buffer |
| 821 |
$mainframe =& mosMainFrame::getInstance(); |
$mainframe =& mosMainFrame::getInstance(); |
| 822 |
$customs = $mainframe->getCustomPathWay(); |
$customs = $mainframe->getCustomPathWay(); |
| 823 |
$last = count($this->_names) - 1; |
$last = count($this->_names) - 1; |
| 824 |
if ($last == 0 AND count($customs == 0)) return ''; |
if (($last == 0) AND (count($customs) == 0)) return ''; |
| 825 |
$result = "<span class='pathway'>"; |
$result = "<span class='pathway'>"; |
| 826 |
$config =& mamboCore::getMamboCore(); |
$config =& mamboCore::getMamboCore(); |
| 827 |
$rootpath = $config->rootPath(); |
$rootpath = $config->rootPath(); |
| 1393 |
$checker = explode(',', $types); |
$checker = explode(',', $types); |
| 1394 |
$result = null; |
$result = null; |
| 1395 |
foreach ($this->_menus as $menu) { |
foreach ($this->_menus as $menu) { |
| 1396 |
if (in_array($menu->menutype, $checker)) $result[] = $menu; |
if (in_array($menu->type, $checker)) $result[] = $menu; |
| 1397 |
} |
} |
| 1398 |
return $result; |
return $result; |
| 1399 |
} |
} |
| 1455 |
return null; |
return null; |
| 1456 |
} |
} |
| 1457 |
|
|
| 1458 |
|
function getSectionItemId($sectionid, $gbs = 1){ |
| 1459 |
|
static $__sectionsItemds; |
| 1460 |
|
|
| 1461 |
|
if (isset($__sectionsItemids[$sectionid])) return $__sectionsItemids[$sectionid]; |
| 1462 |
|
|
| 1463 |
|
$_Itemid = null; |
| 1464 |
|
if ($_Itemid == null ) { |
| 1465 |
|
// Search in sections |
| 1466 |
|
$_Itemid = $this->getIDByTypeCid ('content_section', $sectionid); |
| 1467 |
|
} |
| 1468 |
|
if ($_Itemid == null ) { |
| 1469 |
|
// Search in sections |
| 1470 |
|
$_Itemid = $this->getIDByTypeCid ('content_blog_section', $sectionid); |
| 1471 |
|
} |
| 1472 |
|
|
| 1473 |
|
if ($_Itemid == null && $gbs) { |
| 1474 |
|
// Search in global blog section |
| 1475 |
|
$_Itemid = $this->getIDByTypeCid('content_blog_section', 0); |
| 1476 |
|
} |
| 1477 |
|
if ($_Itemid != null) $__sectionsItemids[$sectionid] = $_Itemid; |
| 1478 |
|
return $_Itemid; |
| 1479 |
|
} |
| 1480 |
|
|
| 1481 |
|
function getCategoryItemId($catid){ |
| 1482 |
|
static $__categoriesItemids; |
| 1483 |
|
|
| 1484 |
|
if (isset($__categoriesItemids[$catid])) return $__categoriesItemids[$catid]; |
| 1485 |
|
|
| 1486 |
|
$_Itemid = null; |
| 1487 |
|
if ($_Itemid == null) { |
| 1488 |
|
// Search in blog categories |
| 1489 |
|
$_Itemid = $this->getIDByTypeCid ('content_blog_category', $catid); |
| 1490 |
|
} |
| 1491 |
|
if ($_Itemid == null) { |
| 1492 |
|
// Search in categories |
| 1493 |
|
$_Itemid = $this->getIDByTypeCid ('content_category', $catid); |
| 1494 |
|
} |
| 1495 |
|
|
| 1496 |
|
if ($_Itemid != null) $__categoriesItemids[$catid] = $_Itemid; |
| 1497 |
|
|
| 1498 |
|
return $_Itemid; |
| 1499 |
|
} |
| 1500 |
|
|
| 1501 |
/** |
/** |
| 1502 |
* Enter description here... |
* Enter description here... |
| 1503 |
* |
* |
| 1625 |
function setPathway ($Itemid) { |
function setPathway ($Itemid) { |
| 1626 |
if ($Itemid) { |
if ($Itemid) { |
| 1627 |
$menu =& $this->getMenuByID($Itemid); |
$menu =& $this->getMenuByID($Itemid); |
| 1628 |
|
if (!$menu) return; |
| 1629 |
if ($menu->parent) $this->setPathway($menu->parent); |
if ($menu->parent) $this->setPathway($menu->parent); |
| 1630 |
$pathway =& mosPathway::getInstance(); |
$pathway =& mosPathway::getInstance(); |
| 1631 |
$pathway->addItem($menu->name, $menu->link."&Itemid=$Itemid"); |
$pathway->addItem($menu->name, $menu->link."&Itemid=$Itemid"); |
| 1646 |
if ($this->getIDLikeLink($dblink) == 0) return true; |
if ($this->getIDLikeLink($dblink) == 0) return true; |
| 1647 |
if ($Itemid) { |
if ($Itemid) { |
| 1648 |
$menu =& $this->getMenuByID($Itemid); |
$menu =& $this->getMenuByID($Itemid); |
| 1649 |
|
if (!$menu) return false; |
| 1650 |
if (strpos($menu->link,$dblink) ===0) { |
if (strpos($menu->link,$dblink) ===0) { |
| 1651 |
$access = $menu->access; |
$access = $menu->access; |
| 1652 |
} elseif ($menu_option == 'com_content' AND $Itemid == 1) { |
} elseif ($menu_option == 'com_content' AND $Itemid == 1) { |
| 1746 |
*/ |
*/ |
| 1747 |
function mosShowVIMenu( &$params ) { |
function mosShowVIMenu( &$params ) { |
| 1748 |
global $my, $cur_template, $Itemid; |
global $my, $cur_template, $Itemid; |
| 1749 |
if (mamboCore::get('mosConfig_shownoauth')) $maxaccess = 0; |
if (mamboCore::get('mosConfig_shownoauth')) $maxaccess = 9999999; |
| 1750 |
else $maxaccess = $my->getAccessGid(); |
else $maxaccess = $my->getAccessGid(); |
| 1751 |
$rows =& $this->getByParentOrder(0, $params->get('menutype'), $maxaccess); |
$rows =& $this->getByParentOrder(0, $params->get('menutype'), $maxaccess); |
| 1752 |
foreach ($rows as $i=>$row) $crosslink[$row->id] = $i; |
foreach ($rows as $i=>$row) $crosslink[$row->id] = $i; |
| 1833 |
function mosShowHFMenu( &$params, $style=0 ) { |
function mosShowHFMenu( &$params, $style=0 ) { |
| 1834 |
global $my, $cur_template, $Itemid; |
global $my, $cur_template, $Itemid; |
| 1835 |
|
|
| 1836 |
if (mamboCore::get('mosConfig_shownoauth')) $maxaccess = 0; |
if (mamboCore::get('mosConfig_shownoauth')) $maxaccess = 9999999; |
| 1837 |
else $maxaccess = $my->getAccessGid(); |
else $maxaccess = $my->getAccessGid(); |
| 1838 |
$rows =& $this->getByParentOrder(0, $params->get('menutype'), $maxaccess, true); |
$rows =& $this->getByParentOrder(0, $params->get('menutype'), $maxaccess, true); |
| 1839 |
|
|
| 1986 |
$result = array(); |
$result = array(); |
| 1987 |
if (isset( $this->_events[$event] )) { |
if (isset( $this->_events[$event] )) { |
| 1988 |
foreach ($this->_events[$event] as $func) { |
foreach ($this->_events[$event] as $func) { |
| 1989 |
|
$botargs = $args; |
| 1990 |
if (is_callable( $func[0] )) { |
if (is_callable( $func[0] )) { |
| 1991 |
$botparams = $this->_bots[$func[1]]->params; |
$botparams = $this->_bots[$func[1]]->params; |
| 1992 |
$args[] = new mosParameters($botparams); |
$botargs[] = new mosParameters($botparams); |
| 1993 |
$args[] = $event; |
$botargs[] = $event; |
| 1994 |
if ($doUnpublished) { |
if ($doUnpublished) { |
| 1995 |
$args[0] = $this->_bots[$func[1]]->published; |
$botargs[0] = $this->_bots[$func[1]]->published; |
| 1996 |
$result[] = call_user_func_array( $func[0], $args ); |
$result[] = call_user_func_array( $func[0], $botargs ); |
| 1997 |
} else if ($this->_bots[$func[1]]->published) { |
} else if ($this->_bots[$func[1]]->published) { |
| 1998 |
$result[] = call_user_func_array( $func[0], $args ); |
$result[] = call_user_func_array( $func[0], $botargs ); |
| 1999 |
} |
} |
| 2000 |
} |
} |
| 2001 |
} |
} |
| 2488 |
if ($mos_change_template) { |
if ($mos_change_template) { |
| 2489 |
// check that template exists in case it was deleted |
// check that template exists in case it was deleted |
| 2490 |
$path = mamboCore::get('mosConfig_absolute_path')."/templates/$mos_change_template/index.php"; |
$path = mamboCore::get('mosConfig_absolute_path')."/templates/$mos_change_template/index.php"; |
| 2491 |
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)) { |
| 2492 |
$lifetime = 60*10; |
$lifetime = 60*10; |
| 2493 |
$cur_template = $mos_change_template; |
$cur_template = $mos_change_template; |
| 2494 |
setcookie( "mos_user_template", "$mos_change_template", time()+$lifetime); |
setcookie( "mos_user_template", "$mos_change_template", time()+$lifetime); |
| 2696 |
$head['meta'] = implode( "\n", $head['meta'] ); |
$head['meta'] = implode( "\n", $head['meta'] ); |
| 2697 |
|
|
| 2698 |
$my = mamboCore::get('currentUser'); |
$my = mamboCore::get('currentUser'); |
| 2699 |
$head['mambojavascript'] = $my->id ? "<script language=\"JavaScript1.2\" src=".mamboCore::get('mosConfig_live_site')."/includes/js/mambojavascript.js\" type=\"text/javascript\"></script>" : ''; |
$head['mambojavascript'] = $my->id ? '<script type="text/javascript" src="'.mamboCore::get('mosConfig_live_site').'/includes/js/mambojavascript.js"></script>' : ''; |
| 2700 |
|
|
| 2701 |
$head['custom'] = array(); |
$head['custom'] = array(); |
| 2702 |
foreach ($this->_head['custom'] as $html) |
foreach ($this->_head['custom'] as $html) |
| 2715 |
$configuration =& mamboCore::getMamboCore(); |
$configuration =& mamboCore::getMamboCore(); |
| 2716 |
$head['favicon'] = "<link rel=\"shortcut icon\" href=\"".$configuration->getFavIcon()."\" />"; |
$head['favicon'] = "<link rel=\"shortcut icon\" href=\"".$configuration->getFavIcon()."\" />"; |
| 2717 |
|
|
| 2718 |
|
if (mamboCore::get('mosConfig_sef')) { |
| 2719 |
|
$baseHref = sefRelToAbs('index.php?'.mosGetParam ($_SERVER,"QUERY_STRING","")); |
| 2720 |
|
$head['base'] = "<base href=\"{$baseHref}/\" />"; |
| 2721 |
|
} |
| 2722 |
|
|
| 2723 |
foreach($head as $key=>$value) |
foreach($head as $key=>$value) |
| 2724 |
$this->_head['output'][$key] = "$value"; |
$this->_head['output'][$key] = "$value"; |
| 2725 |
|
|
| 2769 |
$handler =& new contentHandler(); |
$handler =& new contentHandler(); |
| 2770 |
return $handler->getContentItemLinkCount(); |
return $handler->getContentItemLinkCount(); |
| 2771 |
} |
} |
| 2772 |
|
|
| 2773 |
|
function formId($option='', $task='', $my='') { |
| 2774 |
|
$option=trim($option);$task=trim($task); |
| 2775 |
|
if (!$option) die('Illegal option for mainframe formId in core.classes.php'); |
| 2776 |
|
if (!$task) die('Illegal task for mainframe formId in core.classes.php'); |
| 2777 |
|
if (!is_object($my)) die('Illegal user object for mainframe formId in core.classes.php'); |
| 2778 |
|
mos_session_start(); |
| 2779 |
|
$hash = md5(microtime().mt_rand()); |
| 2780 |
|
$_SESSION['mosfid'] = md5($hash.$option.$task.$my->id.mamboCore::get('mosConfig_secret')); |
| 2781 |
|
return $hash; |
| 2782 |
|
} |
| 2783 |
|
|
| 2784 |
|
function validFormId($option='', $task='', $my='') { |
| 2785 |
|
$option=trim($option);$task=trim($task); |
| 2786 |
|
if (!$option) die('Illegal option for mainframe validFormId in core.classes.php'); |
| 2787 |
|
if (!$task) die('Illegal task for mainframe validFormId in core.classes.php'); |
| 2788 |
|
if (!is_object($my)) die('Illegal user object for mainframe validFormId in core.classes.php'); |
| 2789 |
|
if (!isset($_REQUEST['f'])) die('Missing hash for mainframe validFormId in core.classes.php'); |
| 2790 |
|
if (!isset($_SESSION['mosfid'])) return false; |
| 2791 |
|
$valid = $_SESSION['mosfid'] == md5($_REQUEST['f'].$option.$task.$my->id.mamboCore::get('mosConfig_secret')); |
| 2792 |
|
unset($_SESSION['mosfid']); |
| 2793 |
|
return $valid; |
| 2794 |
|
} |
| 2795 |
|
|
| 2796 |
/** |
/** |
| 2797 |
* retained for backward compatability |
* retained for backward compatability |
| 2798 |
*/ |
*/ |
| 2807 |
/** |
/** |
| 2808 |
* @return object A function cache object |
* @return object A function cache object |
| 2809 |
*/ |
*/ |
| 2810 |
function &getCache( $group='' ) { |
function &getCache( $group='', $plugin = 'Function' ) { |
| 2811 |
|
if (!in_array($plugin,array('Function','Output'))){ |
| 2812 |
|
die('Cache plugin not available'); |
| 2813 |
|
} |
| 2814 |
$mosConfig_absolute_path = mamboCore::get('mosConfig_absolute_path'); |
$mosConfig_absolute_path = mamboCore::get('mosConfig_absolute_path'); |
| 2815 |
require_once($mosConfig_absolute_path.'/includes/Cache/Lite/Function.php'); |
require_once($mosConfig_absolute_path.'/includes/Cache/Lite/'.$plugin.'.php'); |
| 2816 |
$path = mamboCore::get('mosConfig_cachepath'); |
$path = mamboCore::get('mosConfig_cachepath'); |
| 2817 |
$caching = mamboCore::get('mosConfig_caching'); |
$caching = mamboCore::get('mosConfig_caching'); |
| 2818 |
$time = mamboCore::get('mosConfig_cachetime'); |
$time = mamboCore::get('mosConfig_cachetime'); |
| 2822 |
'defaultGroup' => $group, |
'defaultGroup' => $group, |
| 2823 |
'lifeTime' => $time |
'lifeTime' => $time |
| 2824 |
); |
); |
| 2825 |
$cache =& new Cache_Lite_Function( $options ); |
$className = 'Cache_Lite_'.$plugin; |
| 2826 |
|
$cache =& new $className( $options ); |
| 2827 |
return $cache; |
return $cache; |
| 2828 |
} |
} |
| 2829 |
/** |
/** |