| 49 |
} |
} |
| 50 |
|
|
| 51 |
function sefRelToAbs ($string) { |
function sefRelToAbs ($string) { |
| 52 |
$sef = mosSEF::getInstance(); |
$sef =& mosSEF::getInstance(); |
| 53 |
return $sef->sefRelToAbs($string); |
return $sef->sefRelToAbs($string); |
| 54 |
} |
} |
| 55 |
|
|
| 64 |
function mamboCore () { |
function mamboCore () { |
| 65 |
global $adminside; |
global $adminside; |
| 66 |
$this->rootPath = dirname(__FILE__); |
$this->rootPath = dirname(__FILE__); |
|
// $this->rootPath = substr($_SERVER['SCRIPT_FILENAME'],0,-strlen($_SERVER['PHP_SELF'])+1); |
|
|
// if ($adminside) $this->rootPath = substr($this->rootPath,0,strlen($this->rootPath)-14); |
|
| 67 |
$this->checkConfig(); |
$this->checkConfig(); |
| 68 |
$this->Itemid = mosGetParam($_REQUEST, 'Itemid', 0); |
$this->Itemid = mosGetParam($_REQUEST, 'Itemid', 0); |
| 69 |
$this->getConfig(); |
$this->getConfig(); |
| 124 |
while ($f AND !feof($f)) { |
while ($f AND !feof($f)) { |
| 125 |
$line = fgets($f, 256); |
$line = fgets($f, 256); |
| 126 |
$altered = str_replace('$', '$this->', $line); |
$altered = str_replace('$', '$this->', $line); |
| 127 |
if ($line != $altered) $code .= $altered; |
if ($altered != $line) $code .= $altered; |
| 128 |
} |
} |
| 129 |
} |
} |
| 130 |
else { |
else { |
| 135 |
eval($code); |
eval($code); |
| 136 |
$subdir = substr(dirname(__FILE__), strlen($_SERVER['DOCUMENT_ROOT'])); |
$subdir = substr(dirname(__FILE__), strlen($_SERVER['DOCUMENT_ROOT'])); |
| 137 |
$this->subdirectory = str_replace('\\', '/', $subdir); |
$this->subdirectory = str_replace('\\', '/', $subdir); |
| 138 |
$this->mosConfig_live_site = 'http://'.$_SERVER['SERVER_NAME'].$this->subdirectory; |
$scheme = isset($_SERVER['HTTP_SCHEME']) ? $_SERVER['HTTP_SCHEME'] : ((isset($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS'] != 'off')) ? 'https' : 'http'); |
| 139 |
|
if (isset($_SERVER['HTTP_HOST'])) { |
| 140 |
|
$withport = explode(':', $_SERVER['HTTP_HOST']); |
| 141 |
|
$servername = $withport[0]; |
| 142 |
|
if (isset($withport[1])) $port = ':'.$withport[1]; |
| 143 |
|
} |
| 144 |
|
elseif (isset($_SERVER['SERVER_NAME'])) $servername = $_SERVER['SERVER_NAME']; |
| 145 |
|
else trigger_error(T_('Impossible to determine the name of this server'), E_USER_ERROR); |
| 146 |
|
if (!isset($port) AND !empty($_SERVER['SERVER_PORT'])) $port = ':'.$_SERVER['SERVER_PORT']; |
| 147 |
|
if (isset($port)) { |
| 148 |
|
if (($scheme == 'http' AND $port == ':80') OR ($scheme == 'https' AND $port == ':443')) $port = ''; |
| 149 |
|
} |
| 150 |
|
else $port = ''; |
| 151 |
|
$this->mosConfig_live_site = $scheme.'://'.$servername.$port.$this->subdirectory; |
| 152 |
|
// $this->mosConfig_live_site = 'http://'.$_SERVER['SERVER_NAME'].$this->subdirectory; |
| 153 |
$this->mosConfig_absolute_path = $this->rootPath; |
$this->mosConfig_absolute_path = $this->rootPath; |
| 154 |
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); |
| 155 |
foreach ($matches[1] as $match) $GLOBALS[$match] = $this->$match; |
foreach ($matches[1] as $match) $GLOBALS[$match] = $this->$match; |
| 261 |
$this->Itemid = mosGetParam($_REQUEST, 'Itemid', 0); |
$this->Itemid = mosGetParam($_REQUEST, 'Itemid', 0); |
| 262 |
if ($option = strtolower(mosGetParam($_REQUEST, 'option'))); |
if ($option = strtolower(mosGetParam($_REQUEST, 'option'))); |
| 263 |
else { |
else { |
| 264 |
$menuhandler = mosMenuHandler::getInstance(); |
$menuhandler =& mosMenuHandler::getInstance(); |
| 265 |
$menus =& $menuhandler->getByParentOrder($this->Itemid, 'mainmenu'); |
$menus =& $menuhandler->getByParentOrder($this->Itemid, 'mainmenu'); |
| 266 |
$this->Itemid = $menus[0]->id; |
$this->Itemid = $menus[0]->id; |
| 267 |
$_REQUEST['Itemid'] = $this->Itemid; |
$_REQUEST['Itemid'] = $this->Itemid; |
| 280 |
if ($this->Itemid === 0) { |
if ($this->Itemid === 0) { |
| 281 |
if ( $option == 'com_content') { |
if ( $option == 'com_content') { |
| 282 |
require_once($this->rootPath().'/components/com_content/content.class.php'); |
require_once($this->rootPath().'/components/com_content/content.class.php'); |
| 283 |
$handler = contentHandler::getInstance(); |
$handler =& contentHandler::getInstance(); |
| 284 |
$this->Itemid = $handler->getItemid(mosGetParam($_REQUEST, 'id', 0 )); |
$this->Itemid = $handler->getItemid(mosGetParam($_REQUEST, 'id', 0 )); |
| 285 |
$_REQUEST['Itemid'] = $this->Itemid; |
$_REQUEST['Itemid'] = $this->Itemid; |
| 286 |
} |
} |
| 287 |
else { |
else { |
| 288 |
$menuhandler = mosMenuHandler::getInstance(); |
$menuhandler =& mosMenuHandler::getInstance(); |
| 289 |
$this->Itemid = $menuhandler->getIdLikeLink("index.php?option=$option"); |
$this->Itemid = $menuhandler->getIdLikeLink("index.php?option=$option"); |
| 290 |
if ($this->Itemid === 0) { |
if ($this->Itemid === 0) { |
| 291 |
$menuhandler = mosMenuHandler::getInstance(); |
$menuhandler =& mosMenuHandler::getInstance(); |
| 292 |
$menus =& $menuhandler->getByParentOrder($this->Itemid, 'mainmenu'); |
$menus =& $menuhandler->getByParentOrder($this->Itemid, 'mainmenu'); |
| 293 |
} |
} |
| 294 |
} |
} |
| 298 |
|
|
| 299 |
function redirect ($url, $msg='') { |
function redirect ($url, $msg='') { |
| 300 |
$callcheck = array('InputFilter', 'process'); |
$callcheck = array('InputFilter', 'process'); |
| 301 |
if (!is_callable($callcheck)) require_once(mamboCore::get('mosConfig_absolute_path').'/includes/phpinputfilter/class.inputfilter.php'); |
if (!is_callable($callcheck)) require_once(mamboCore::get('mosConfig_absolute_path').'/includes/phpInputFilter/class.inputfilter.php'); |
| 302 |
// specific filters |
// specific filters |
| 303 |
$iFilter =& new InputFilter(); |
$iFilter =& new InputFilter(); |
| 304 |
$url = $iFilter->process( $url ); |
$url = $iFilter->process( $url ); |
| 337 |
|
|
| 338 |
function handleLogin () { |
function handleLogin () { |
| 339 |
require_once($this->rootPath().'/includes/authenticator.php'); |
require_once($this->rootPath().'/includes/authenticator.php'); |
| 340 |
$authenticator = mamboAuthenticator::getInstance(); |
$authenticator =& mamboAuthenticator::getInstance(); |
| 341 |
$loggedin = $authenticator->loginUser(); |
$loggedin = $authenticator->loginUser(); |
| 342 |
if ($loggedin) $this->logMessage(_LOGIN_SUCCESS); |
if ($loggedin) $this->logMessage(_LOGIN_SUCCESS); |
| 343 |
else mamboCore::redirect('index.php'); |
else mamboCore::redirect('index.php'); |
| 345 |
|
|
| 346 |
function handleLogout () { |
function handleLogout () { |
| 347 |
require_once($this->rootPath().'/includes/authenticator.php'); |
require_once($this->rootPath().'/includes/authenticator.php'); |
| 348 |
$authenticator = mamboAuthenticator::getInstance(); |
$authenticator =& mamboAuthenticator::getInstance(); |
| 349 |
$authenticator->logoutUser(); |
$authenticator->logoutUser(); |
| 350 |
$this->logMessage(_LOGOUT_SUCCESS); |
$this->logMessage(_LOGOUT_SUCCESS); |
| 351 |
} |
} |
| 356 |
header( 'Cache-Control: no-store, no-cache, must-revalidate' ); |
header( 'Cache-Control: no-store, no-cache, must-revalidate' ); |
| 357 |
header( 'Cache-Control: post-check=0, pre-check=0', false ); |
header( 'Cache-Control: post-check=0, pre-check=0', false ); |
| 358 |
header( 'Pragma: no-cache' ); |
header( 'Pragma: no-cache' ); |
| 359 |
$mambothandler = mosMambotHandler::getInstance(); |
$mambothandler =& mosMambotHandler::getInstance(); |
| 360 |
$mambothandler->loadBotGroup('system'); |
$mambothandler->loadBotGroup('system'); |
| 361 |
$mambothandler->trigger('onHeaders', array($this)); |
$mambothandler->trigger('onHeaders', array($this)); |
| 362 |
} |
} |
| 365 |
$this->do_gzip_compress = FALSE; |
$this->do_gzip_compress = FALSE; |
| 366 |
//zlib.output_compression and ob_gzhandler don't get along well so we'll check to make |
//zlib.output_compression and ob_gzhandler don't get along well so we'll check to make |
| 367 |
//that zlib.output_compression is not enable in the php.ini before turning on ob_gzhandler |
//that zlib.output_compression is not enable in the php.ini before turning on ob_gzhandler |
| 368 |
if ( $this->mosConfig_gzip == 1 && (int)ini_get('zlib.output_compression') != 1 ) { |
if ( $this->mosConfig_gzip == 1 AND (int)ini_get('zlib.output_compression') != 1 ) { |
| 369 |
$phpver = phpversion(); |
$phpver = phpversion(); |
| 370 |
$useragent = mosGetParam( $_SERVER, 'HTTP_USER_AGENT', '' ); |
$useragent = mosGetParam( $_SERVER, 'HTTP_USER_AGENT', '' ); |
| 371 |
$canZip = mosGetParam( $_SERVER, 'HTTP_ACCEPT_ENCODING', '' ); |
$canZip = mosGetParam( $_SERVER, 'HTTP_ACCEPT_ENCODING', '' ); |
| 372 |
|
|
| 373 |
if ( $phpver >= '4.0.4pl1' && |
if ( $phpver >= '4.0.4pl1' AND |
| 374 |
( strpos($useragent,'compatible') !== false || |
( strpos($useragent,'compatible') !== false || |
| 375 |
strpos($useragent,'Gecko') !== false |
strpos($useragent,'Gecko') !== false |
| 376 |
) |
) |
| 537 |
* Constructor |
* Constructor |
| 538 |
*/ |
*/ |
| 539 |
function mosPathway () { |
function mosPathway () { |
| 540 |
$menuhandler = mosMenuHandler::getInstance(); |
$menuhandler =& mosMenuHandler::getInstance(); |
| 541 |
$menus =& $menuhandler->getByParentOrder(0,'mainmenu'); |
$menus =& $menuhandler->getByParentOrder(0,'mainmenu'); |
| 542 |
$home = $menus[0]; |
$home = $menus[0]; |
| 543 |
$this->_names[] = $home->name; |
$this->_names[] = $home->name; |
| 578 |
function makePathway () { |
function makePathway () { |
| 579 |
$last = count($this->_names) - 1; |
$last = count($this->_names) - 1; |
| 580 |
if ($last == 0) return ''; |
if ($last == 0) return ''; |
| 581 |
$mainframe = mosMainFrame::getInstance(); |
$mainframe =& mosMainFrame::getInstance(); |
| 582 |
$result = "<span class='pathway'>"; |
$result = "<span class='pathway'>"; |
| 583 |
$config = mamboCore::getMamboCore(); |
$config =& mamboCore::getMamboCore(); |
| 584 |
$rootpath = $config->rootPath(); |
$rootpath = $config->rootPath(); |
| 585 |
$imgPath = 'templates/'.$mainframe->getTemplate().'/images/arrow.png'; |
$imgPath = 'templates/'.$mainframe->getTemplate().'/images/arrow.png'; |
| 586 |
if (file_exists( "$rootpath/$imgPath" )) $img = "<img src='$config->mosConfig_live_site/$imgPath' border='0' alt='arrow' />"; |
if (file_exists( "$rootpath/$imgPath" )) $img = "<img src='$config->mosConfig_live_site/$imgPath' border='0' alt='arrow' />"; |
| 650 |
* @param database A database connector object |
* @param database A database connector object |
| 651 |
*/ |
*/ |
| 652 |
function mosMenu( $dummy ) { |
function mosMenu( $dummy ) { |
| 653 |
$db = mamboDatabase::getInstance(); |
$db =& mamboDatabase::getInstance(); |
| 654 |
$this->mosDBTable( '#__menu', 'id', $db ); |
$this->mosDBTable( '#__menu', 'id', $db ); |
| 655 |
} |
} |
| 656 |
/** |
/** |
| 662 |
$k = $this->_tbl_key; |
$k = $this->_tbl_key; |
| 663 |
if ($oid !== null) $this->$k = $oid; |
if ($oid !== null) $this->$k = $oid; |
| 664 |
if ($this->$k === null) return false; |
if ($this->$k === null) return false; |
| 665 |
$menuhandler = mosMenuHandler::getInstance(); |
$menuhandler =& mosMenuHandler::getInstance(); |
| 666 |
$menu = $menuhandler->getMenuById($this->$k); |
$menu =& $menuhandler->getMenuById($this->$k); |
| 667 |
if ($menu) { |
if ($menu) { |
| 668 |
foreach (get_object_vars($menu) as $key=>$data) $this->$key = $data; |
foreach (get_object_vars($menu) as $key=>$data) $this->$key = $data; |
| 669 |
return true; |
return true; |
| 808 |
$ret = true; |
$ret = true; |
| 809 |
if (is_dir($path)) { |
if (is_dir($path)) { |
| 810 |
$topdir =& new mosDirectory($path); |
$topdir =& new mosDirectory($path); |
| 811 |
$files = $topdir->listFiles ('', 'file', true); |
$files =& $topdir->listFiles ('', 'file', true); |
| 812 |
$dirs = $topdir->listFiles ('', 'dir', true); |
$dirs =& $topdir->listFiles ('', 'dir', true); |
| 813 |
} |
} |
| 814 |
else { |
else { |
| 815 |
$files = array($path); |
$files = array($path); |
| 877 |
$subdirectory->deleteAll(); |
$subdirectory->deleteAll(); |
| 878 |
unset($subdirectory); |
unset($subdirectory); |
| 879 |
} |
} |
| 880 |
$filemanager = mosFileManager::getInstance(); |
$filemanager =& mosFileManager::getInstance(); |
| 881 |
$files =& $this->listAll ('file', false, true); |
$files =& $this->listAll ('file', false, true); |
| 882 |
foreach ($files as $file) $filemanager->deleteFile($file); |
foreach ($files as $file) $filemanager->deleteFile($file); |
| 883 |
$filemanager->deleteDirectory($this->path); |
$filemanager->deleteDirectory($this->path); |
| 885 |
|
|
| 886 |
function createFresh () { |
function createFresh () { |
| 887 |
$this->deleteAll(); |
$this->deleteAll(); |
| 888 |
$filemanager = mosFileManager::getInstance(); |
$filemanager =& mosFileManager::getInstance(); |
| 889 |
$filemanager->createDirectory($this->path); |
$filemanager->createDirectory($this->path); |
| 890 |
return true; |
return true; |
| 891 |
} |
} |
| 892 |
|
|
| 893 |
function createIfNeeded () { |
function createIfNeeded () { |
| 894 |
if (!file_exists($this->path)) { |
if (!file_exists($this->path)) { |
| 895 |
$filemanager = mosFileManager::getInstance(); |
$filemanager =& mosFileManager::getInstance(); |
| 896 |
$filemanager->createDirectory($this->path); |
$filemanager->createDirectory($this->path); |
| 897 |
} |
} |
| 898 |
} |
} |
| 910 |
|
|
| 911 |
function getSize () { |
function getSize () { |
| 912 |
$totalsize = 0; |
$totalsize = 0; |
| 913 |
$files = $this->listFiles(); |
$files =& $this->listFiles(); |
| 914 |
foreach ($files as $file) $totalsize += filesize($this->path.$file); |
foreach ($files as $file) $totalsize += filesize($this->path.$file); |
| 915 |
return $totalsize; |
return $totalsize; |
| 916 |
} |
} |
| 936 |
*/ |
*/ |
| 937 |
function mosMenuHandler() { |
function mosMenuHandler() { |
| 938 |
global $my; |
global $my; |
| 939 |
$database = mamboDatabase::getInstance(); |
$database =& mamboDatabase::getInstance(); |
| 940 |
$sql = "SELECT * FROM #__menu ORDER BY name"; |
$sql = "SELECT * FROM #__menu ORDER BY name"; |
| 941 |
$this->_menus =& $database->doSQLget($sql, 'mosMenu'); |
$this->_menus =& $database->doSQLget($sql, 'mosMenu'); |
| 942 |
if (!$this->_menus) $this->_menus = array(); |
if (!$this->_menus) $this->_menus = array(); |
| 1084 |
|
|
| 1085 |
function setPathway ($Itemid) { |
function setPathway ($Itemid) { |
| 1086 |
if ($Itemid) { |
if ($Itemid) { |
| 1087 |
$menu = $this->getMenuByID($Itemid); |
$menu =& $this->getMenuByID($Itemid); |
| 1088 |
if ($menu->parent) $this->setPathway($menu->parent); |
if ($menu->parent) $this->setPathway($menu->parent); |
| 1089 |
$pathway = mosPathway::getInstance(); |
$pathway =& mosPathway::getInstance(); |
| 1090 |
$pathway->addItem($menu->name, $menu->link."&Itemid=$Itemid"); |
$pathway->addItem($menu->name, $menu->link."&Itemid=$Itemid"); |
| 1091 |
} |
} |
| 1092 |
} |
} |
| 1104 |
if (in_array($menu_option, $exceptions)) return true; |
if (in_array($menu_option, $exceptions)) return true; |
| 1105 |
$dblink="index.php?option=$menu_option"; |
$dblink="index.php?option=$menu_option"; |
| 1106 |
if ($Itemid) { |
if ($Itemid) { |
| 1107 |
$menu = $this->getMenuByID($Itemid); |
$menu =& $this->getMenuByID($Itemid); |
| 1108 |
if (strpos($menu->link,$dblink) ===0) $access = $menu->access; |
if (strpos($menu->link,$dblink) ===0) $access = $menu->access; |
| 1109 |
} |
} |
| 1110 |
if (!isset($access)) { |
if (!isset($access)) { |
| 1111 |
if ($task!='') $dblink .= "&task=$task"; |
if ($task!='') $dblink .= "&task=$task"; |
| 1112 |
$menu = $this->maxAccessLink($dblink); |
$menu =& $this->maxAccessLink($dblink); |
| 1113 |
if (isset($menu)) { |
if (isset($menu)) { |
| 1114 |
$access = $menu->access; |
$access = $menu->access; |
| 1115 |
mamboCore::set('Itemid', $menu->id); |
mamboCore::set('Itemid', $menu->id); |
| 1129 |
$temp = split("&task=view&id=", $mitem->link); |
$temp = split("&task=view&id=", $mitem->link); |
| 1130 |
if (isset($temp[1])) { |
if (isset($temp[1])) { |
| 1131 |
require_once(mamboCore::get('mosConfig_absolute_path').'/components/com_content/content.class.php'); |
require_once(mamboCore::get('mosConfig_absolute_path').'/components/com_content/content.class.php'); |
| 1132 |
$handler = contentHandler::getInstance(); |
$handler =& contentHandler::getInstance(); |
| 1133 |
$mitem->link .= '&Itemid='.$handler->getItemid($temp[1]); |
$mitem->link .= '&Itemid='.$handler->getItemid($temp[1]); |
| 1134 |
} |
} |
| 1135 |
break; |
break; |
| 1329 |
$my = mamboCore::is_set('currentUser') ? mamboCore::get('currentUser') : null; |
$my = mamboCore::is_set('currentUser') ? mamboCore::get('currentUser') : null; |
| 1330 |
$gid = $my ? $my->gid : 0; |
$gid = $my ? $my->gid : 0; |
| 1331 |
$this->_events = array(); |
$this->_events = array(); |
| 1332 |
$database = mamboDatabase::getInstance(); |
$database =& mamboDatabase::getInstance(); |
| 1333 |
$database->setQuery( "SELECT folder, element, published, params, CONCAT_WS('/',folder,element) AS lookup" |
$database->setQuery( "SELECT folder, element, published, params, CONCAT_WS('/',folder,element) AS lookup" |
| 1334 |
. "\nFROM #__mambots" |
. "\nFROM #__mambots" |
| 1335 |
. "\nWHERE published >= 1 AND access <= $gid" |
. "\nWHERE published >= 1 AND access <= $gid" |
| 1497 |
* @param database A database connector object |
* @param database A database connector object |
| 1498 |
*/ |
*/ |
| 1499 |
function mosUser( $dummy ) { |
function mosUser( $dummy ) { |
| 1500 |
$database = mamboDatabase::getInstance(); |
$database =& mamboDatabase::getInstance(); |
| 1501 |
$this->mosDBTable( '#__users', 'id', $database ); |
$this->mosDBTable( '#__users', 'id', $database ); |
| 1502 |
} |
} |
| 1503 |
|
|
| 1505 |
* Fill a user object with information from the current session |
* Fill a user object with information from the current session |
| 1506 |
*/ |
*/ |
| 1507 |
function getSessionData() { |
function getSessionData() { |
| 1508 |
$session = mosSession::getCurrent(); |
$session =& mosSession::getCurrent(); |
| 1509 |
$this->id = intval( $session->userid ); |
$this->id = intval( $session->userid ); |
| 1510 |
$this->username = $session->username; |
$this->username = $session->username; |
| 1511 |
$this->usertype = $session->usertype; |
$this->usertype = $session->usertype; |
| 1672 |
*/ |
*/ |
| 1673 |
function logout() { |
function logout() { |
| 1674 |
require_once(mamboCore::get('mosConfig_absolute_path').'/includes/authenticator.php'); |
require_once(mamboCore::get('mosConfig_absolute_path').'/includes/authenticator.php'); |
| 1675 |
$authenticator = mamboAuthenticator::getInstance(); |
$authenticator =& mamboAuthenticator::getInstance(); |
| 1676 |
$authenticator->logoutUser(); |
$authenticator->logoutUser(); |
| 1677 |
} |
} |
| 1678 |
/** |
/** |
| 1680 |
*/ |
*/ |
| 1681 |
function login ($username=null,$passwd=null) { |
function login ($username=null,$passwd=null) { |
| 1682 |
require_once(mamboCore::get('mosConfig_absolute_path').'/includes/authenticator.php'); |
require_once(mamboCore::get('mosConfig_absolute_path').'/includes/authenticator.php'); |
| 1683 |
$authenticator = mamboAuthenticator::getInstance(); |
$authenticator =& mamboAuthenticator::getInstance(); |
| 1684 |
return $authenticator->loginUser($username, $passwd); |
return $authenticator->loginUser($username, $passwd); |
| 1685 |
} |
} |
| 1686 |
|
|
| 1749 |
* @param string The value of the content attibute to append to the existing |
* @param string The value of the content attibute to append to the existing |
| 1750 |
* Tags ordered in with Site Keywords and Description first |
* Tags ordered in with Site Keywords and Description first |
| 1751 |
*/ |
*/ |
| 1752 |
function appendMetaTag( $name, $content ) { |
function appendMetaTag( $name, $content, $ifEmpty=false ) { |
| 1753 |
list($name, $content) = $this->_tidyMetaData($name, $content); |
list($name, $content) = $this->_tidyMetaData($name, $content); |
| 1754 |
$tag = $this->_getMetaTag($name); |
$tag = $this->_getMetaTag($name); |
| 1755 |
|
if ($tag[0] AND $ifEmpty) return; |
| 1756 |
if ($tag[0] AND $content) $content .= ', '; |
if ($tag[0] AND $content) $content .= ', '; |
| 1757 |
$tag[0] = $content.$tag[0]; |
$tag[0] = $content.$tag[0]; |
| 1758 |
$this->_head['meta'][$name] = $tag; |
$this->_head['meta'][$name] = $tag; |
| 1872 |
if ($mos_change_template) { |
if ($mos_change_template) { |
| 1873 |
// check that template exists in case it was deleted |
// check that template exists in case it was deleted |
| 1874 |
$path = mamboCore::get('mosConfig_absolute_path')."/templates/$mos_change_template/index.php"; |
$path = mamboCore::get('mosConfig_absolute_path')."/templates/$mos_change_template/index.php"; |
| 1875 |
if (file_exists( $path)) { |
if (strpos($mos_change_template,'..') == false AND strpos($mos_change_template,':') == false AND file_exists($path)) { |
| 1876 |
$lifetime = 60*10; |
$lifetime = 60*10; |
| 1877 |
$cur_template = $mos_change_template; |
$cur_template = $mos_change_template; |
| 1878 |
setcookie( "mos_user_template", "$mos_change_template", time()+$lifetime); |
setcookie( "mos_user_template", "$mos_change_template", time()+$lifetime); |
| 2001 |
*/ |
*/ |
| 2002 |
function getItemid ($id, $typed=1, $link=1, $bs=1, $bc=1, $gbs=1) { |
function getItemid ($id, $typed=1, $link=1, $bs=1, $bc=1, $gbs=1) { |
| 2003 |
require_once(mamboCore::get('mosConfig_absolute_path').'/components/com_content/content.class.php'); |
require_once(mamboCore::get('mosConfig_absolute_path').'/components/com_content/content.class.php'); |
| 2004 |
$handler = contentHandler::getInstance(); |
$handler =& contentHandler::getInstance(); |
| 2005 |
return $handler->getItemid($id, $typed, $link, $bs, $bc, $gbs); |
return $handler->getItemid($id, $typed, $link, $bs, $bc, $gbs); |
| 2006 |
} |
} |
| 2007 |
|
|
| 2008 |
function liveBookMark () { |
function liveBookMark () { |
| 2009 |
// support for Firefox Live Bookmarks ability for site syndication |
// support for Firefox Live Bookmarks ability for site syndication |
| 2010 |
$c_handler = mosComponentHandler::getInstance(); |
$c_handler =& mosComponentHandler::getInstance(); |
| 2011 |
$params = $c_handler->getParamsByName('Syndicate'); |
$params = $c_handler->getParamsByName('Syndicate'); |
| 2012 |
$live_bookmark = $params->get( 'live_bookmark', 0 ); |
$live_bookmark = $params->get( 'live_bookmark', 0 ); |
| 2013 |
if ($live_bookmark) { |
if ($live_bookmark) { |
| 2036 |
function mosShowHead () { |
function mosShowHead () { |
| 2037 |
global $_VERSION; |
global $_VERSION; |
| 2038 |
$mosConfig_live_site = mamboCore::get('mosConfig_live_site'); |
$mosConfig_live_site = mamboCore::get('mosConfig_live_site'); |
| 2039 |
$this->appendMetaTag( 'description', mamboCore::get('mosConfig_MetaDesc') ); |
$this->appendMetaTag( 'description', mamboCore::get('mosConfig_MetaDesc'), true ); |
| 2040 |
$this->appendMetaTag( 'keywords', mamboCore::get('mosConfig_MetaKeys') ); |
$this->appendMetaTag( 'keywords', mamboCore::get('mosConfig_MetaKeys'), true ); |
|
$this->addMetaTag( 'Generator', $_VERSION->PRODUCT . " - " . $_VERSION->COPYRIGHT); |
|
|
$this->addMetaTag( 'robots', 'index, follow' ); |
|
| 2041 |
echo $this->getHead(); |
echo $this->getHead(); |
| 2042 |
if (mamboCore::get('mosConfig_sef')) { |
if (mamboCore::get('mosConfig_sef')) { |
| 2043 |
echo "<base href=\"$mosConfig_live_site/\" />\r\n"; |
echo "<base href=\"$mosConfig_live_site/\" />\r\n"; |
| 2050 |
} |
} |
| 2051 |
$this->liveBookMark(); |
$this->liveBookMark(); |
| 2052 |
// outputs link tag for page |
// outputs link tag for page |
| 2053 |
$configuration = mamboCore::getMamboCore(); |
$configuration =& mamboCore::getMamboCore(); |
| 2054 |
?> |
?> |
| 2055 |
<link rel="shortcut icon" href="<?php echo $configuration->getFavIcon();?>" /> |
<link rel="shortcut icon" href="<?php echo $configuration->getFavIcon();?>" /> |
| 2056 |
<?php |
<?php |
| 2118 |
* @param database A database connector object |
* @param database A database connector object |
| 2119 |
*/ |
*/ |
| 2120 |
function mosSession( &$db ) { |
function mosSession( &$db ) { |
| 2121 |
$database = mamboDatabase::getInstance(); |
$database =& mamboDatabase::getInstance(); |
| 2122 |
$this->mosDBTable( '#__session', 'session_id', $database ); |
$this->mosDBTable( '#__session', 'session_id', $database ); |
| 2123 |
$this->time = time(); |
$this->time = time(); |
| 2124 |
} |
} |
| 2145 |
if ($usercookie) { |
if ($usercookie) { |
| 2146 |
// Remember me cookie exists. Login with usercookie info. |
// Remember me cookie exists. Login with usercookie info. |
| 2147 |
require_once (mamboCore::get('mosConfig_absolute_path').'/includes/authenticator.php'); |
require_once (mamboCore::get('mosConfig_absolute_path').'/includes/authenticator.php'); |
| 2148 |
$authenticator = mamboAuthenticator::getInstance(); |
$authenticator =& mamboAuthenticator::getInstance(); |
| 2149 |
$authenticator->authenticateUser ($message, $usercookie['username'], $usercookie['password'], null, $currentSession); |
$authenticator->authenticateUser ($message, $usercookie['username'], $usercookie['password'], null, $currentSession); |
| 2150 |
} |
} |
| 2151 |
} |
} |
| 2363 |
$image_path = $configuration->rootPath().'/images/stories'; |
$image_path = $configuration->rootPath().'/images/stories'; |
| 2364 |
$image_size = 100; |
$image_size = 100; |
| 2365 |
|
|
| 2366 |
$database = mamboDatabase::getInstance(); |
$database =& mamboDatabase::getInstance(); |
| 2367 |
$database->debug(mamboCore::get('mosConfig_debug')); |
$database->debug(mamboCore::get('mosConfig_debug')); |
| 2368 |
|
|
| 2369 |
if (!$adminside) { |
if (!$adminside) { |
| 2372 |
else require_once($configuration->rootPath().'/includes/sef.php'); |
else require_once($configuration->rootPath().'/includes/sef.php'); |
| 2373 |
$urlerror = 0; |
$urlerror = 0; |
| 2374 |
if (mamboCore::get('mosConfig_sef') AND $indextype == 3) { |
if (mamboCore::get('mosConfig_sef') AND $indextype == 3) { |
| 2375 |
$sef = mosSEF::getInstance(); |
$sef =& mosSEF::getInstance(); |
| 2376 |
$urlerror = $sef->sefRetrieval(mamboCore::get('mosConfig_register_globals')); |
$urlerror = $sef->sefRetrieval(mamboCore::get('mosConfig_register_globals')); |
| 2377 |
$indextype = 1; |
$indextype = 1; |
| 2378 |
} |
} |
| 2398 |
// Login will, if it succeeds, start a new session and set $my |
// Login will, if it succeeds, start a new session and set $my |
| 2399 |
if ($option == 'login') { |
if ($option == 'login') { |
| 2400 |
require_once($configuration->rootPath().'/includes/authenticator.php'); |
require_once($configuration->rootPath().'/includes/authenticator.php'); |
| 2401 |
$authenticator = mamboAuthenticator::getInstance(); |
$authenticator =& mamboAuthenticator::getInstance(); |
| 2402 |
$my = $authenticator->loginAdmin($acl); |
$my = $authenticator->loginAdmin($acl); |
| 2403 |
} |
} |
| 2404 |
// If this is not login, we should already have a valid admin session |
// If this is not login, we should already have a valid admin session |
| 2429 |
require_once( $configuration->rootPath().'/administrator/includes/mosAdminMenus.php'); |
require_once( $configuration->rootPath().'/administrator/includes/mosAdminMenus.php'); |
| 2430 |
require_once($configuration->rootPath().'/administrator/includes/admin.php'); |
require_once($configuration->rootPath().'/administrator/includes/admin.php'); |
| 2431 |
require_once( $configuration->rootPath() . '/includes/cmtclasses.php' ); |
require_once( $configuration->rootPath() . '/includes/cmtclasses.php' ); |
| 2432 |
$_MAMBOTS = mosMambotHandler::getInstance(); |
$_MAMBOTS =& mosMambotHandler::getInstance(); |
| 2433 |
// If no_html is set, we avoid starting the template, and go straight to the component |
// If no_html is set, we avoid starting the template, and go straight to the component |
| 2434 |
if ($no_html) { |
if ($no_html) { |
| 2435 |
if ($path = $mainframe->getPath( "admin" )) require $path; |
if ($path = $mainframe->getPath( "admin" )) require $path; |
| 2467 |
if ($option == 'login') $configuration->handleLogin(); |
if ($option == 'login') $configuration->handleLogin(); |
| 2468 |
elseif ($option == 'logout') $configuration->handleLogout(); |
elseif ($option == 'logout') $configuration->handleLogout(); |
| 2469 |
|
|
| 2470 |
$session = mosSession::getCurrent(); |
$session =& mosSession::getCurrent(); |
| 2471 |
$my =& new mosUser($database); |
$my =& new mosUser($database); |
| 2472 |
$my->getSessionData(); |
$my->getSessionData(); |
| 2473 |
mamboCore::set('currentUser',$my); |
mamboCore::set('currentUser',$my); |
| 2490 |
$mainframe->detect(); |
$mainframe->detect(); |
| 2491 |
|
|
| 2492 |
/** @global mosPlugin $_MAMBOTS */ |
/** @global mosPlugin $_MAMBOTS */ |
| 2493 |
$_MAMBOTS = mosMambotHandler::getInstance(); |
$_MAMBOTS =& mosMambotHandler::getInstance(); |
| 2494 |
require_once( $configuration->rootPath().'/editor/editor.php' ); |
require_once( $configuration->rootPath().'/editor/editor.php' ); |
| 2495 |
require_once( $configuration->rootPath() . '/includes/gacl.class.php' ); |
require_once( $configuration->rootPath() . '/includes/gacl.class.php' ); |
| 2496 |
require_once( $configuration->rootPath() . '/includes/gacl_api.class.php' ); |
require_once( $configuration->rootPath() . '/includes/gacl_api.class.php' ); |
| 2498 |
|
|
| 2499 |
/** Get the component handler */ |
/** Get the component handler */ |
| 2500 |
require_once( $configuration->rootPath() . '/includes/cmtclasses.php' ); |
require_once( $configuration->rootPath() . '/includes/cmtclasses.php' ); |
| 2501 |
$c_handler = mosComponentHandler::getInstance(); |
$c_handler =& mosComponentHandler::getInstance(); |
| 2502 |
$c_handler->startBuffer(); |
$c_handler->startBuffer(); |
| 2503 |
|
|
| 2504 |
if (!$urlerror AND $path = $mainframe->getPath( 'front' )) { |
if (!$urlerror AND $path = $mainframe->getPath( 'front' )) { |
| 2505 |
$menuhandler = mosMenuHandler::getInstance(); |
$menuhandler =& mosMenuHandler::getInstance(); |
| 2506 |
$ret = $menuhandler->menuCheck($Itemid, $option, $task, $gid); |
$ret = $menuhandler->menuCheck($Itemid, $option, $task, $gid); |
| 2507 |
$menuhandler->setPathway($Itemid); |
$menuhandler->setPathway($Itemid); |
| 2508 |
if ($ret) require_once( $path ); |
if ($ret) require_once( $path ); |
| 2525 |
echo '<font color=\"red\"><b>'.T_('Template File Not Found! Looking for template').'</b></font>'.$cur_template; |
echo '<font color=\"red\"><b>'.T_('Template File Not Found! Looking for template').'</b></font>'.$cur_template; |
| 2526 |
} else { |
} else { |
| 2527 |
require_once( 'templates/'. $cur_template .'/index.php' ); |
require_once( 'templates/'. $cur_template .'/index.php' ); |
| 2528 |
$mambothandler = mosMambotHandler::getInstance(); |
$mambothandler =& mosMambotHandler::getInstance(); |
| 2529 |
$mambothandler->loadBotGroup('system'); |
$mambothandler->loadBotGroup('system'); |
| 2530 |
$mambothandler->trigger('afterTemplate', array($configuration)); |
$mambothandler->trigger('afterTemplate', array($configuration)); |
| 2531 |
echo "<!-- ".time()." -->"; |
echo "<!-- ".time()." -->"; |