PageRenderTime 44ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/administrator/index3.php

https://bitbucket.org/dgough/annamaria-daneswood-25102012
PHP | 108 lines | 73 code | 16 blank | 19 comment | 15 complexity | 62a7cc5af5b01ac3f130b1f4b41c3ba1 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1
  1. <?php
  2. /**
  3. * @version $Id: index3.php 10041 2008-02-15 21:48:13Z eddieajau $
  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. // Set flag that this is a parent file
  14. define( '_VALID_MOS', 1 );
  15. if (!file_exists( '../configuration.php' )) {
  16. header( 'Location: ../installation/index.php' );
  17. exit();
  18. }
  19. require( '../globals.php' );
  20. require( '../configuration.php' );
  21. // SSL check - $http_host returns <live site url>:<port number if it is 443>
  22. $http_host = explode(':', $_SERVER['HTTP_HOST'] );
  23. if( (!empty( $_SERVER['HTTPS'] ) && strtolower( $_SERVER['HTTPS'] ) != 'off' || isset( $http_host[1] ) && $http_host[1] == 443) && substr( $mosConfig_live_site, 0, 8 ) != 'https://' ) {
  24. $mosConfig_live_site = 'https://'.substr( $mosConfig_live_site, 7 );
  25. }
  26. require_once( $mosConfig_absolute_path . '/includes/joomla.php' );
  27. include_once( $mosConfig_absolute_path . '/language/'. $mosConfig_lang. '.php' );
  28. require_once( $mosConfig_absolute_path . '/administrator/includes/admin.php' );
  29. // must start the session before we create the mainframe object
  30. session_name( md5( $mosConfig_live_site ) );
  31. session_start();
  32. $option = strval( strtolower( mosGetParam( $_REQUEST, 'option', '' ) ) );
  33. $task = strval( mosGetParam( $_REQUEST, 'task', '' ) );
  34. // mainframe is an API workhorse, lots of 'core' interaction routines
  35. $mainframe = new mosMainFrame( $database, $option, '..', true );
  36. // admin session handling
  37. $my = $mainframe->initSessionAdmin( $option, $task );
  38. // initialise some common request directives
  39. $act = strtolower( mosGetParam( $_REQUEST, 'act', '' ) );
  40. $section = mosGetParam( $_REQUEST, 'section', '' );
  41. $mosmsg = strval( strip_tags( mosGetParam( $_REQUEST, 'mosmsg', '' ) ) );
  42. $no_html = mosGetParam( $_REQUEST, 'no_html', '' );
  43. $id = intval( mosGetParam( $_REQUEST, 'id', 0 ) );
  44. // start the html output
  45. if ($no_html) {
  46. if ($path = $mainframe->getPath( 'admin' )) {
  47. require $path;
  48. }
  49. exit;
  50. }
  51. initGzip();
  52. ?>
  53. <?php echo "<?xml version=\"1.0\"?>"; ?>
  54. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  55. <html xmlns="http://www.w3.org/1999/xhtml">
  56. <head>
  57. <title><?php echo $mosConfig_sitename; ?> - Administration [Joomla!]</title>
  58. <link rel="stylesheet" href="templates/<?php echo $mainframe->getTemplate(); ?>/css/template_css.css" type="text/css" />
  59. <link rel="stylesheet" href="templates/<?php echo $mainframe->getTemplate(); ?>/css/theme.css" type="text/css" />
  60. <script language="JavaScript" src="../includes/js/JSCookMenu_mini.js" type="text/javascript"></script>
  61. <script language="JavaScript" src="includes/js/ThemeOffice/theme.js" type="text/javascript"></script>
  62. <script language="JavaScript" src="../includes/js/joomla.javascript.js" type="text/javascript"></script>
  63. <meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
  64. <?php
  65. $mainframe->set( 'loadEditor', true );
  66. include_once( $mosConfig_absolute_path . '/editor/editor.php' );
  67. initEditor();
  68. ?>
  69. </head>
  70. <body>
  71. <?php
  72. if ($mosmsg) {
  73. if (!get_magic_quotes_gpc()) {
  74. $mosmsg = addslashes( $mosmsg );
  75. }
  76. echo "\n<script language=\"javascript\" type=\"text/javascript\">alert('$mosmsg');</script>";
  77. }
  78. // Show list of items to edit or delete or create new
  79. if ($path = $mainframe->getPath( 'admin' )) {
  80. require $path;
  81. } else {
  82. ?>
  83. <img src="images/joomla_logo_black.jpg" border="0" alt="Joomla! Logo" />
  84. <br />
  85. <?php
  86. }
  87. ?>
  88. </body>
  89. </html>
  90. <?php
  91. doGzip();
  92. ?>