Annotation of /mambo/branches/4.5.3h/index2.php
Parent Directory
|
Revision Log
Revision 22 - (view) (download)
| 1 : | root | 1 | <?php |
| 2 : | /** | ||
| 3 : | * @version $Id: index2.php,v 1.3 2005/11/21 11:57:20 csouza Exp $ | ||
| 4 : | * @package Mambo | ||
| 5 : | * @copyright (C) 2000 - 2005 Miro International Pty Ltd | ||
| 6 : | * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL | ||
| 7 : | * Mambo 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 : | <link rel="stylesheet" href="templates/<?php echo $cur_template;?>/css/template_css.css" type="text/css" /> | ||
| 118 : | <meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" /> | ||
| 119 : | <meta name="robots" content="noindex, nofollow"> | ||
| 120 : | </head> | ||
| 121 : | <body class="contentpane"> | ||
| 122 : | <?php mosMainBody(); ?> | ||
| 123 : | </body> | ||
| 124 : | </html> | ||
| 125 : | <?php | ||
| 126 : | } else { | ||
| 127 : | mosMainBody(); | ||
| 128 : | } | ||
| 129 : | doGzip(); | ||
| 130 : | |||
| 131 : | ?> |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |
Web Hosting provided by Network Redux.

