[ PHPXref.com ] [ Generated: Sun Jul 20 18:59:55 2008 ] [ NS Mamu 1.0.0 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> index2.php (source)

   1  <?php
   2  /**

   3  * @version $Id: index2.php, v1.0 2006/01/19 08:46:38 NS Mamu Team Exp $

   4  * package NS Mamu

   5  * @Copyright (C) 2003 - 2006 NS Network Organization. All right reserved.

   6  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL

   7  * NS Mamu is Free Software

   8  */
   9  
  10  // fix to address the globals overwrite problem in php versions < 4.4.1

  11  $protect_globals = array('_REQUEST', '_GET', '_POST', '_COOKIE', '_FILES', '_SERVER', '_ENV', 'GLOBALS', '_SESSION');
  12  foreach ($protect_globals as $global) {
  13      if ( in_array($global , array_keys($_REQUEST)) ||
  14           in_array($global , array_keys($_GET))     ||
  15           in_array($global , array_keys($_POST))    ||
  16           in_array($global , array_keys($_COOKIE))  ||
  17           in_array($global , array_keys($_FILES))) {
  18          die("Invalid Request.");
  19      }
  20  }
  21  
  22  /** Set flag that this is a parent file */

  23  define( "_VALID_MOS", 1 );
  24  
  25  include_once  ('globals.php');
  26  require_once ('configuration.php');
  27  require_once  ('includes/mambo.php');
  28  if (file_exists( 'components/com_sef/sef.php' )) {
  29      require_once( 'components/com_sef/sef.php' );
  30  } else {
  31      require_once ( 'includes/sef.php' );
  32  }
  33  require_once  ('includes/frontend.php');
  34  $database = new database( $mosConfig_host, $mosConfig_user, $mosConfig_password, $mosConfig_db, $mosConfig_dbprefix );
  35  $database->debug( $mosConfig_debug );
  36  
  37  // retrieve some expected url (or form) arguments

  38  $option     = trim( strtolower( mosGetParam( $_REQUEST, 'option' ) ) );
  39  $no_html     = intval( mosGetParam( $_REQUEST, 'no_html', 0 ) );
  40  $Itemid     = strtolower( trim( mosGetParam( $_REQUEST, 'Itemid',0 ) ) );
  41  $act         = mosGetParam( $_REQUEST, 'act', '' );
  42  $do_pdf     = intval( mosGetParam( $_REQUEST, 'do_pdf', 0 ) );
  43  
  44  // mainframe is an API workhorse, lots of 'core' interaction routines

  45  $mainframe = new mosMainFrame( $database, $option, '.' );
  46  
  47  $mainframe->initSession();
  48  if ($mosConfig_lang=='') {
  49      $mosConfig_lang='english';
  50  }
  51  include_once ('language/'.$mosConfig_lang.'.php');
  52  
  53  if ($mosConfig_offline == 1){
  54      include ( 'offline.php' );
  55      exit();
  56  }
  57  
  58  if ($option == 'login') {
  59      $mainframe->login();
  60      mosRedirect('index.php');
  61  } else if ($option == 'logout') {
  62      $mainframe->logout();
  63      mosRedirect( 'index.php' );
  64  }
  65  
  66  if ( $do_pdf == 1 ){
  67      include  ('includes/pdf.php');
  68      exit();
  69  }
  70  
  71  $acl = new gacl_api();
  72  
  73  // get the information about the current user from the sessions table

  74  $my = $mainframe->getUser();
  75  
  76  $mainframe->detect();
  77  
  78  $gid = intval( $my->gid );
  79  
  80  $cur_template = $mainframe->getTemplate();
  81  
  82  // precapture the output of the component

  83  require_once ( $mosConfig_absolute_path . '/editor/editor.php' );
  84  
  85  ob_start();
  86  if ($path = $mainframe->getPath( 'front' )) {
  87      $task = mosGetParam( $_REQUEST, 'task', '' );
  88      $ret = mosMenuCheck( $Itemid, $option, $task, $gid );
  89      if ($ret) {
  90          require_once( $path );
  91      } else {
  92          mosNotAuth();
  93      }
  94  } else {
  95      echo _NOT_EXIST;
  96  }
  97  $_MOS_OPTION['buffer'] = ob_get_contents();
  98  ob_end_clean();
  99  
 100  initGzip();
 101  
 102  header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" );
 103  header( "Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT" );
 104  header( "Cache-Control: no-store, no-cache, must-revalidate" );
 105  header( "Cache-Control: post-check=0, pre-check=0", false );
 106  header( "Pragma: no-cache" );
 107  // start basic HTML

 108  if ( $no_html == 0 ) {
 109      // needed to seperate the ISO number from the language file constant _ISO

 110      $iso = split( '=', _ISO );
 111      // xml prolog

 112      echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>';
 113      ?>
 114      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 115      <html xmlns="http://www.w3.org/1999/xhtml">
 116      <head>
 117      <?php echo $mainframe->getHead(); ?>
 118      <link rel="stylesheet" href="<?php echo $mosConfig_live_site;?>/templates/<?php echo $cur_template;?>/css/template_css.css" type="text/css" />
 119      <link href="<?php echo $mosConfig_live_site;?>/templates/<?php echo $cur_template; ?>/css/forum_css.css" rel="stylesheet" type="text/css" />
 120      <link rel="shortcut icon" href="<?php echo $mosConfig_live_site; ?>/images/favicon.ico" />
 121      <meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
 122      <meta name="robots" content="noindex, nofollow" />
 123      </head>
 124      <body class="contentpane">
 125      <?php mosMainBody(); ?>
 126      </body>
 127      </html>
 128      <?php
 129  } else {
 130      mosMainBody();
 131  }
 132  doGzip();
 133  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]