[ Index ]
 

Code source de Joomla 1.0.13

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/ -> index2.php (source)

   1  <?php
   2  /**
   3  * @version $Id: index2.php 6024 2006-12-18 22:30:07Z friesengeist $
   4  * @package Joomla
   5  * @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
   6  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
   7  * Joomla! is free software. This version may have been modified pursuant
   8  * to the GNU General Public License, and as distributed it includes or
   9  * is derivative of works licensed under the GNU General Public License or
  10  * other free or open source software licenses.
  11  * See COPYRIGHT.php for copyright notices and details.
  12  */
  13  
  14  // Set flag that this is a parent file
  15  define( '_VALID_MOS', 1 );
  16  
  17  require ( 'globals.php' );
  18  require_once( 'configuration.php' );
  19  
  20  // SSL check - $http_host returns <live site url>:<port number if it is 443>
  21  $http_host = explode(':', $_SERVER['HTTP_HOST'] );
  22  if( (!empty( $_SERVER['HTTPS'] ) && strtolower( $_SERVER['HTTPS'] ) != 'off' || isset( $http_host[1] ) && $http_host[1] == 443) && substr( $mosConfig_live_site, 0, 8 ) != 'https://' ) {
  23      $mosConfig_live_site = 'https://'.substr( $mosConfig_live_site, 7 );
  24  }
  25  
  26  require_once ( 'includes/joomla.php' );
  27  
  28  // displays offline/maintanance page or bar
  29  if ($mosConfig_offline == 1) {
  30      require ( $mosConfig_absolute_path .'/offline.php' );
  31  }
  32  
  33  // load system bot group
  34  $_MAMBOTS->loadBotGroup( 'system' );
  35  
  36  // trigger the onStart events
  37  $_MAMBOTS->trigger( 'onStart' );
  38  
  39  if (file_exists( $mosConfig_absolute_path .'/components/com_sef/sef.php' )) {
  40      require_once( $mosConfig_absolute_path .'/components/com_sef/sef.php' );
  41  } else {
  42      require_once ( $mosConfig_absolute_path .'/includes/sef.php' );
  43  }
  44  require_once ( $mosConfig_absolute_path .'/includes/frontend.php' );
  45  
  46  // retrieve some expected url (or form) arguments
  47  $option     = strtolower( strval( mosGetParam( $_REQUEST, 'option' ) ) );
  48  $Itemid     = intval( mosGetParam( $_REQUEST, 'Itemid', 0 ) );
  49  $no_html     = intval( mosGetParam( $_REQUEST, 'no_html', 0 ) );
  50  $act         = strval( mosGetParam( $_REQUEST, 'act', '' ) );
  51  $do_pdf     = intval( mosGetParam( $_REQUEST, 'do_pdf', 0 ) );
  52  
  53  // mainframe is an API workhorse, lots of 'core' interaction routines
  54  $mainframe = new mosMainFrame( $database, $option, '.' );
  55  $mainframe->initSession();
  56  
  57  // trigger the onAfterStart events
  58  $_MAMBOTS->trigger( 'onAfterStart' );
  59  
  60  // get the information about the current user from the sessions table
  61  $my = $mainframe->getUser();
  62  // patch to lessen the impact on templates
  63  if ($option == 'search') {
  64      $option = 'com_search';
  65  }
  66  
  67  // loads english language file by default
  68  if ($mosConfig_lang=='') {
  69      $mosConfig_lang = 'english';
  70  }
  71  include_once( $mosConfig_absolute_path .'/language/' . $mosConfig_lang . '.php' );
  72  
  73  
  74  if ($option == 'login') {
  75      $mainframe->login();
  76      mosRedirect('index.php');
  77  } else if ($option == 'logout') {
  78      $mainframe->logout();
  79      mosRedirect( 'index.php' );
  80  }
  81  
  82  if ( $do_pdf == 1 ){
  83      include $mosConfig_absolute_path .'/includes/pdf.php';
  84      exit();
  85  }
  86  
  87  
  88  // detect first visit
  89  $mainframe->detect();
  90  
  91  $gid = intval( $my->gid );
  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  
 100  if ($path = $mainframe->getPath( 'front' )) {
 101      $task     = strval( mosGetParam( $_REQUEST, 'task', '' ) );
 102      $ret     = mosMenuCheck( $Itemid, $option, $task, $gid );
 103      if ($ret) {
 104          require_once( $path );
 105      } else {
 106          mosNotAuth();
 107      }
 108  } else {
 109      header("HTTP/1.0 404 Not Found");
 110      echo _NOT_EXIST;
 111  }
 112  $_MOS_OPTION['buffer'] = ob_get_contents();
 113  
 114  ob_end_clean();
 115  
 116  initGzip();
 117  
 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  // display the offline alert if an admin is logged in
 125  if (defined( '_ADMIN_OFFLINE' )) {
 126      include ( $mosConfig_absolute_path .'/offlinebar.php' );
 127  }
 128  
 129  // start basic HTML
 130  if ( $no_html == 0 ) {
 131      $customIndex2 = 'templates/'. $mainframe->getTemplate() .'/index2.php';
 132      if (file_exists( $customIndex2 )) {
 133          require( $customIndex2 );
 134      } else {
 135          // needed to seperate the ISO number from the language file constant _ISO
 136          $iso = split( '=', _ISO );
 137          // xml prolog
 138          echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>';
 139      ?>
 140      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 141      <html xmlns="http://www.w3.org/1999/xhtml">
 142          <head>
 143              <?php echo $mainframe->getHead(); ?>
 144              <link rel="stylesheet" href="templates/<?php echo $cur_template;?>/css/template_css.css" type="text/css" />
 145              <link rel="shortcut icon" href="<?php echo $mosConfig_live_site; ?>/images/favicon.ico" />
 146              <meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
 147              <meta name="robots" content="noindex, nofollow" />
 148              <?php if ($my->id || $mainframe->get( 'joomlaJavascript' )) { ?>
 149              <script language="JavaScript" src="<?php echo $mosConfig_live_site;?>/includes/js/joomla.javascript.js" type="text/javascript"></script>
 150              <?php } ?>
 151          </head>
 152          <body class="contentpane">
 153              <?php mosMainBody(); ?>
 154          </body>
 155      </html>
 156      <?php
 157      }
 158  } else {
 159      mosMainBody();
 160  }
 161  doGzip();
 162  ?>


Généré le : Wed Nov 21 14:43:32 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics