debug( $mosConfig_debug ); $acl = new gacl_api(); if ($mosConfig_offline == 2) { $mosConfig_offline = 1; $GLOBALS['mosConfig_offline'] = 1; $scook = md5( 'site'.$mosConfig_live_site); if (isset($_COOKIE[$scook])) { $sesid = md5($_COOKIE[$scook].$_SERVER['REMOTE_ADDR']); $database->setQuery("SELECT COUNT(*) FROM #__session WHERE session_id='$sesid' AND gid='25'"); if (intval($database->loadResult()) > 0) { $mosConfig_offline = 0; $GLOBALS['mosConfig_offline'] = 0; } } } if ($mosConfig_offline == 1) { include( $mosConfig_absolute_path.'/offline.php' ); exit(); } require_once( $mosConfig_absolute_path.'/includes/sef.php' ); require_once( $mosConfig_absolute_path.'/includes/frontend.php' ); /** retrieve some expected url (or form) arguments */ $option = strval( strtolower( mosGetParam( $_REQUEST, 'option' ) ) ); $Itemid = intval( mosGetParam( $_REQUEST, 'Itemid', 0 ) ); if ($option == '') { if ($Itemid) { $query = "SELECT id, link FROM #__menu WHERE menutype='mainmenu'" . "\n AND id = '$Itemid' AND published = '1'" . "\n AND ((language IS NULL) OR (language LIKE '%$lang%'))"; $database->setQuery( $query, '#__', 1, 0 ); } else { $query = "SELECT id, link FROM #__menu" . "\n WHERE menutype='mainmenu' AND published='1'" . "\n AND ((language IS NULL) OR (language LIKE '%$lang%'))" . "\n ORDER BY parent, ordering "; $database->setQuery( $query, '#__', 1, 0 ); } $menu = new mosMenu( $database ); if ($database->loadObject( $menu )) { $Itemid = $menu->id; } $link = $menu->link; if (($pos = strpos( $link, '?' )) !== false) { $link = substr( $link, $pos+1 ). '&Itemid='.$Itemid; } parse_str( $link, $temp ); /** this is a patch, need to rework when globals are handled better */ foreach ($temp as $k=>$v) { $GLOBALS[$k] = $v; $_REQUEST[$k] = $v; if ($k == 'option') { $option = $v; } } } /** mainframe is an API workhorse, lots of 'core' interaction routines */ $mainframe = new mosMainFrame( $database, $option, '.' ); $mainframe->initSession(); // checking if we can find the Itemid thru the content if ( $option == 'com_content' && $Itemid === 0 ) { $id = intval( mosGetParam( $_REQUEST, 'id', 0 ) ); $Itemid = intval($mainframe->getItemid( $id )); } /** do we have a valid Itemid yet?? */ if ( $Itemid === 0 ) { /** Nope, just use the homepage then. */ $query = "SELECT id FROM #__menu" . "\n WHERE menutype='mainmenu' AND published='1'" . "\n AND ((language IS NULL) OR (language LIKE '%$lang%'))" . "\n ORDER BY parent, ordering"; $database->setQuery( $query, '#__', 1, 0 ); $Itemid = intval($database->loadResult()); } /** patch to lessen the impact on templates */ if ($option == 'search') { $option = 'com_search'; } //frontend login & logout controls $return = strval( mosGetParam( $_REQUEST, 'return', NULL ) ); if ($option == 'login') { $mainframe->login(); if ( mosGetParam( $_POST, 'message', 0 ) ) { ?> logout(); if ( mosGetParam( $_POST, 'message', 0 ) ) { ?> getUser(); //Elxis Access Control System @require_once( $mosConfig_absolute_path.'/includes/Core/access.control.php' ); /** detect first visit */ $mainframe->detect(); $gid = intval( $my->gid ); // gets template for page $cur_template = $mainframe->getTemplate(); /** temp fix - this feature is currently disabled */ /** @global A places to store information from processing of the component */ $_MOS_OPTION = array(); // precapture the output of the component require_once( $mosConfig_absolute_path.'/editor/editor.php' ); ob_start(); if ($path = $mainframe->getPath( 'front' )) { $task = strval(mosGetParam( $_REQUEST, 'task', '' )); $ret = mosMenuCheck( $Itemid, $option, $task, $gid ); if ($ret) { require_once( $path ); } else { mosNotAuth(); } } else { @header( 'HTTP/1.0 404 Not Found' ); echo _NOT_EXIST; } $_MOS_OPTION['buffer'] = ob_get_contents(); if (ob_get_length() > 0) { ob_end_clean(); } initGzip(); if(!headers_sent()) { header( 'Content-type: text/html; charset=utf-8' ); header( 'Expires: Mon, 26 Jul 1997 05:00:00 GMT' ); header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' ); header( 'Cache-Control: no-store, no-cache, must-revalidate' ); header( 'Cache-Control: post-check=0, pre-check=0', false ); header( 'Pragma: no-cache' ); } // loads template file if ( !file_exists( $mosConfig_absolute_path.'/templates/'.$cur_template.'/index.php' ) ) { echo _TEMPLATE_WARN . $cur_template; } else { require_once( $mosConfig_absolute_path.'/templates/'.$cur_template.'/index.php' ); echo ''._LEND; } // displays queries performed for page if ($mosConfig_debug) { echo $database->_ticker . ' queries executed'; echo '
'._LEND;
 	foreach ($database->_log as $k=>$sql) {
 	    echo $k+1 . _LEND . $sql . '
'._LEND; } echo '
'._LEND; } doGzip(); //close FTP connection if we used it $fmanager->closeFTP(); ?>