| 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 ); |
| 399 |
global $adminside; |
global $adminside; |
| 400 |
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')) { |
| 401 |
require_once($this->rootPath().'/administrator/includes/admin.php'); |
require_once($this->rootPath().'/administrator/includes/admin.php'); |
|
session_name(md5($this->mosConfig_live_site)); |
|
| 402 |
session_start(); |
session_start(); |
| 403 |
$session =& mosSession::getCurrent(); |
$session =& mosSession::getCurrent(); |
| 404 |
|
if (!isset($_SESSION['initiated'])) { |
| 405 |
|
session_regenerate_id(true); |
| 406 |
|
$_SESSION['initiated'] = true; |
| 407 |
|
} |
| 408 |
$my =& new mosUser(); |
$my =& new mosUser(); |
| 409 |
$my->getSessionData(); |
$my->getSessionData(); |
| 410 |
if (mosSession::validate($my)) return; |
if (mosSession::validate($my)) return; |
| 483 |
* @return unknown |
* @return unknown |
| 484 |
*/ |
*/ |
| 485 |
function determineOptionAndItemid () { |
function determineOptionAndItemid () { |
| 486 |
$this->Itemid = mosGetParam($_REQUEST, 'Itemid', 0); |
$this->Itemid = (int)mosGetParam($_REQUEST, 'Itemid', 0); |
| 487 |
if ($option = strtolower(mosGetParam($_REQUEST, 'option'))); |
if ($option = strtolower(mosGetParam($_REQUEST, 'option'))); |
| 488 |
else { |
else { |
| 489 |
$menuhandler =& mosMenuHandler::getInstance(); |
$menuhandler =& mosMenuHandler::getInstance(); |
| 490 |
$menus =& $menuhandler->getByParentOrder($this->Itemid, 'mainmenu'); |
$menus =& $menuhandler->getByParentOrder($this->Itemid, 'mainmenu'); |
| 491 |
|
if (count($menus)) { |
| 492 |
$this->Itemid = $menus[0]->id; |
$this->Itemid = $menus[0]->id; |
| 493 |
$_REQUEST['Itemid'] = $this->Itemid; |
$_REQUEST['Itemid'] = $this->Itemid; |
| 494 |
$link = $menus[0]->link; |
$link = $menus[0]->link; |
| 500 |
if (isset($temp['option'])) $option = $temp['option']; |
if (isset($temp['option'])) $option = $temp['option']; |
| 501 |
else return ''; |
else return ''; |
| 502 |
} |
} |
| 503 |
|
} |
| 504 |
/** patch to lessen the impact on templates */ |
/** patch to lessen the impact on templates */ |
| 505 |
if ($option == 'search') $option = 'com_search'; |
if ($option == 'search') $option = 'com_search'; |
| 506 |
// checking if we can find the Itemid thru the component |
// checking if we can find the Itemid thru the component |
| 508 |
if ( $option == 'com_content') { |
if ( $option == 'com_content') { |
| 509 |
require_once($this->rootPath().'/components/com_content/content.class.php'); |
require_once($this->rootPath().'/components/com_content/content.class.php'); |
| 510 |
$handler =& contentHandler::getInstance(); |
$handler =& contentHandler::getInstance(); |
| 511 |
$this->Itemid = $handler->getItemid(mosGetParam($_REQUEST, 'id', 0 )); |
$this->Itemid = (int)$handler->getItemid(mosGetParam($_REQUEST, 'id', 0 )); |
| 512 |
$_REQUEST['Itemid'] = $this->Itemid; |
$_REQUEST['Itemid'] = $this->Itemid; |
| 513 |
} |
} |
| 514 |
else { |
else { |
| 520 |
} |
} |
| 521 |
} |
} |
| 522 |
} |
} |
| 523 |
return $option; |
return trim(htmlspecialchars($option)); |
| 524 |
} |
} |
| 525 |
|
|
| 526 |
/** |
/** |
| 1585 |
function setPathway ($Itemid) { |
function setPathway ($Itemid) { |
| 1586 |
if ($Itemid) { |
if ($Itemid) { |
| 1587 |
$menu =& $this->getMenuByID($Itemid); |
$menu =& $this->getMenuByID($Itemid); |
| 1588 |
|
if (!$menu) return; |
| 1589 |
if ($menu->parent) $this->setPathway($menu->parent); |
if ($menu->parent) $this->setPathway($menu->parent); |
| 1590 |
$pathway =& mosPathway::getInstance(); |
$pathway =& mosPathway::getInstance(); |
| 1591 |
$pathway->addItem($menu->name, $menu->link."&Itemid=$Itemid"); |
$pathway->addItem($menu->name, $menu->link."&Itemid=$Itemid"); |
| 1606 |
if ($this->getIDLikeLink($dblink) == 0) return true; |
if ($this->getIDLikeLink($dblink) == 0) return true; |
| 1607 |
if ($Itemid) { |
if ($Itemid) { |
| 1608 |
$menu =& $this->getMenuByID($Itemid); |
$menu =& $this->getMenuByID($Itemid); |
| 1609 |
|
if (!$menu) return false; |
| 1610 |
if (strpos($menu->link,$dblink) ===0) { |
if (strpos($menu->link,$dblink) ===0) { |
| 1611 |
$access = $menu->access; |
$access = $menu->access; |
| 1612 |
} elseif ($menu_option == 'com_content' AND $Itemid == 1) { |
} elseif ($menu_option == 'com_content' AND $Itemid == 1) { |
| 2674 |
$configuration =& mamboCore::getMamboCore(); |
$configuration =& mamboCore::getMamboCore(); |
| 2675 |
$head['favicon'] = "<link rel=\"shortcut icon\" href=\"".$configuration->getFavIcon()."\" />"; |
$head['favicon'] = "<link rel=\"shortcut icon\" href=\"".$configuration->getFavIcon()."\" />"; |
| 2676 |
|
|
| 2677 |
|
if (mamboCore::get('mosConfig_sef')) { |
| 2678 |
|
$head['base'] = "<base href=\"".mamboCore::get('mosConfig_live_site')."/\" />"; |
| 2679 |
|
} |
| 2680 |
|
|
| 2681 |
foreach($head as $key=>$value) |
foreach($head as $key=>$value) |
| 2682 |
$this->_head['output'][$key] = "$value"; |
$this->_head['output'][$key] = "$value"; |
| 2683 |
|
|
| 2727 |
$handler =& new contentHandler(); |
$handler =& new contentHandler(); |
| 2728 |
return $handler->getContentItemLinkCount(); |
return $handler->getContentItemLinkCount(); |
| 2729 |
} |
} |
| 2730 |
|
|
| 2731 |
|
function formId($option='', $task='', $my='') { |
| 2732 |
|
$option=trim($option);$task=trim($task); |
| 2733 |
|
if (!$option) die('Illegal option for mainframe formId in core.classes.php'); |
| 2734 |
|
if (!$task) die('Illegal task for mainframe formId in core.classes.php'); |
| 2735 |
|
if (!is_object($my)) die('Illegal user object for mainframe formId in core.classes.php'); |
| 2736 |
|
mos_session_start(); |
| 2737 |
|
$hash = md5(microtime().mt_rand()); |
| 2738 |
|
$_SESSION['mosfid'] = md5($hash.$option.$task.$my->id.mamboCore::get('mosConfig_secret')); |
| 2739 |
|
return $hash; |
| 2740 |
|
} |
| 2741 |
|
|
| 2742 |
|
function validFormId($option='', $task='', $my='') { |
| 2743 |
|
$option=trim($option);$task=trim($task); |
| 2744 |
|
if (!$option) die('Illegal option for mainframe validFormId in core.classes.php'); |
| 2745 |
|
if (!$task) die('Illegal task for mainframe validFormId in core.classes.php'); |
| 2746 |
|
if (!is_object($my)) die('Illegal user object for mainframe validFormId in core.classes.php'); |
| 2747 |
|
if (!isset($_REQUEST['f'])) die('Missing hash for mainframe validFormId in core.classes.php'); |
| 2748 |
|
if (!isset($_SESSION['mosfid'])) return false; |
| 2749 |
|
$valid = $_SESSION['mosfid'] == md5($_REQUEST['f'].$option.$task.$my->id.mamboCore::get('mosConfig_secret')); |
| 2750 |
|
unset($_SESSION['mosfid']); |
| 2751 |
|
return $valid; |
| 2752 |
|
} |
| 2753 |
|
|
| 2754 |
/** |
/** |
| 2755 |
* retained for backward compatability |
* retained for backward compatability |
| 2756 |
*/ |
*/ |