[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * @ Version: $Id: index2.php 1878 2008-01-25 21:26:29Z datahell $ 4 * @ Copyright: Copyright (C) 2006-2008 Elxis.org. All rights reserved. 5 * @ Package: Elxis 6 * @ Subpackage: Elxis 7 * @ Author: Elxis Team 8 * @ E-mail: info@elxis.org 9 * @ URL: http://www.elxis.org 10 * @ License: http://www.gnu.org/copyleft/gpl.html GNU/GPL 11 * Elxis CMS is a Free Software 12 */ 13 14 require_once ( 'includes/Core/security.php' ); 15 16 17 define( '_VALID_MOS', 1 ); 18 session_start(); 19 20 include_once ('globals.php'); 21 require_once ('configuration.php'); 22 if (file_exists($mosConfig_absolute_path.'/installation/index.php')) { 23 include ( $mosConfig_absolute_path.'/offline.php' ); 24 exit(); 25 } 26 27 require_once ( $mosConfig_absolute_path.'/includes/Core/loader.php' ); 28 29 $database = new database( $mosConfig_host, $mosConfig_user, $mosConfig_password, $mosConfig_db, $mosConfig_dbprefix, $mosConfig_dbtype ); 30 $database->debug( $mosConfig_debug ); 31 $acl = new gacl_api(); 32 33 if ($mosConfig_offline == 2) { 34 $mosConfig_offline = 1; 35 $GLOBALS['mosConfig_offline'] = 1; 36 $scook = md5( 'site'.$mosConfig_live_site); 37 if (isset($_COOKIE[$scook])) { 38 $sesid = md5($_COOKIE[$scook].$_SERVER['REMOTE_ADDR']); 39 $database->setQuery("SELECT COUNT(*) FROM #__session WHERE session_id='$sesid' AND gid='25'"); 40 if (intval($database->loadResult()) > 0) { 41 $mosConfig_offline = 0; 42 $GLOBALS['mosConfig_offline'] = 0; 43 } 44 } 45 } 46 47 if ($mosConfig_offline == 1) { 48 include ( $mosConfig_absolute_path.'/offline.php' ); 49 exit(); 50 } 51 52 require_once ( $mosConfig_absolute_path.'/includes/sef.php' ); 53 require_once ($mosConfig_absolute_path.'/includes/frontend.php'); 54 55 //retrieve some expected url (or form) arguments 56 $option = strtolower(strval(mosGetParam( $_REQUEST, 'option', '' ))); 57 $no_html = intval(mosGetParam( $_REQUEST, 'no_html', 0 )); 58 $Itemid = intval(trim( mosGetParam( $_REQUEST, 'Itemid', 0 ))); 59 $act = strval(mosGetParam( $_REQUEST, 'act', '' )); 60 $do_pdf = intval(mosGetParam( $_REQUEST, 'do_pdf', 0 )); 61 $do_rtf = intval(mosGetParam( $_REQUEST, 'do_rtf', 0 )); 62 63 //mainframe is an API workhorse, lots of 'core' interaction routines 64 $mainframe = new mosMainFrame( $database, $option, '.' ); 65 66 $mainframe->initSession(); 67 if ($option == 'login') { 68 $mainframe->login(); 69 mosRedirect('index.php'); 70 } else if ($option == 'logout') { 71 $mainframe->logout(); 72 mosRedirect( 'index.php' ); 73 } 74 75 // get the information about the current user from the sessions table 76 $my = $mainframe->getUser(); 77 78 //Elxis Access Control System 79 @require_once ( $mosConfig_absolute_path.'/includes/Core/access.control.php' ); 80 81 $mainframe->detect(); 82 $gid = intval( $my->gid ); 83 84 if ( $do_pdf == 1 ) { 85 include ($mosConfig_absolute_path.'/includes/pdf.php'); 86 exit(); 87 } 88 if ( $do_rtf == 1 ) { 89 include ($mosConfig_absolute_path.'/includes/rtf.php'); 90 exit(); 91 } 92 93 $cur_template = $mainframe->getTemplate(); 94 95 //precapture the output of the component 96 require_once ( $mosConfig_absolute_path.'/editor/editor.php' ); 97 98 ob_start(); 99 if ($path = $mainframe->getPath( 'front' )) { 100 $task = mosGetParam( $_REQUEST, 'task', '' ); 101 $ret = mosMenuCheck( $Itemid, $option, $task, $gid ); 102 if ($ret) { 103 require_once( $path ); 104 } else { 105 mosNotAuth(); 106 } 107 } else { 108 @header('HTTP/1.0 404 Not Found'); 109 echo _NOT_EXIST; 110 } 111 $_MOS_OPTION['buffer'] = ob_get_contents(); 112 ob_end_clean(); 113 114 initGzip(); 115 116 if(!headers_sent()) { 117 header( 'Content-type: text/html; charset=utf-8' ); 118 header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" ); 119 header( "Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT" ); 120 header( "Cache-Control: no-store, no-cache, must-revalidate" ); 121 header( "Cache-Control: post-check=0, pre-check=0", false ); 122 header( "Pragma: no-cache" ); 123 } 124 125 // start basic HTML 126 if ( $no_html == 0 ) { 127 // needed to seperate the ISO number from the language file constant _ISO 128 $iso = split( '=', _ISO ); 129 130 $rtl = ''; 131 $tempcss = 'template_css.css'; 132 if (_GEM_RTL) { 133 $rtl = ' dir="rtl"'; 134 if (file_exists($mosConfig_absolute_path.'/templates/'.$cur_template.'/css/template_css-rtl.css')) { 135 $tempcss = 'template_css-rtl.css'; 136 } 137 } 138 //xml prolog 139 echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>'._LEND; 140 ?> 141 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 142 <html xmlns="http://www.w3.org/1999/xhtml" lang="<?php echo _LANGUAGE; ?>" xml:lang="<?php echo _LANGUAGE; ?>"<?php echo $rtl; ?>> 143 <head> 144 <meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" /> 145 <?php echo $mainframe->getHead(); ?> 146 <link rel="stylesheet" href="<?php echo $mosConfig_live_site; ?>/includes/standard<?php echo (_GEM_RTL) ? '-rtl' : ''; ?>.css" type="text/css" media="all" /> 147 <link rel="stylesheet" href="<?php echo $mosConfig_live_site; ?>/templates/<?php echo $cur_template; ?>/css/<?php echo $tempcss; ?>" type="text/css" media="all" /> 148 <link rel="shortcut icon" href="<?php echo $mosConfig_live_site; ?>/images/favicon.ico" /> 149 <script language="javascript" src="<?php echo $mosConfig_live_site; ?>/includes/js/elxis.js" type="text/javascript"></script> 150 <meta name="robots" content="noindex, nofollow" /> 151 </head> 152 <body class="contentpane"> 153 <?php mosMainBody(); ?> 154 </body> 155 </html> 156 <?php 157 } else { 158 mosMainBody(); 159 } 160 doGzip(); 161 //close FTP connection if we used it 162 $fmanager->closeFTP(); 163 164 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body