[ Index ] |
|
Code source de Joomla 1.0.13 |
1 <?php 2 /** 3 * @version $Id: offline.php 6020 2006-12-18 19:04:42Z robs $ 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 // no direct access 15 defined( '_VALID_MOS' ) or die( 'Restricted access' ); 16 17 global $database; 18 global $mosConfig_live_site, $mosConfig_lang; 19 20 $adminOffline = false; 21 22 if (!defined( '_INSTALL_CHECK' )) { 23 // this method is different from 1.1 because the session handling is not the same 24 session_name( md5( $mosConfig_live_site ) ); 25 session_start(); 26 27 if (class_exists( 'mosUser' )) { 28 // restore some session variables 29 $admin = new mosUser( $database ); 30 $admin->id = intval( mosGetParam( $_SESSION, 'session_user_id', '' ) ); 31 $admin->username = strval( mosGetParam( $_SESSION, 'session_username', '' ) ); 32 $admin->usertype = strval( mosGetParam( $_SESSION, 'session_usertype', '' ) ); 33 $session_id = mosGetParam( $_SESSION, 'session_id', '' ); 34 $logintime = mosGetParam( $_SESSION, 'session_logintime', '' ); 35 36 // check against db record of session 37 if ($session_id == md5( $admin->id . $admin->username . $admin->usertype . $logintime )) { 38 $query = "SELECT *" 39 . "\n FROM #__session" 40 . "\n WHERE session_id = " . $database->Quote( $session_id ) 41 . "\n AND username = " . $database->Quote( $admin->username ) 42 . "\n AND userid = " . intval( $admin->id ) 43 ; 44 $database->setQuery( $query ); 45 if (!$result = $database->query()) { 46 echo $database->stderr(); 47 } 48 if ($database->getNumRows( $result ) == 1) { 49 define( '_ADMIN_OFFLINE', 1 ); 50 } 51 } 52 } 53 } 54 55 if (!defined( '_ADMIN_OFFLINE' ) || defined( '_INSTALL_CHECK' )) { 56 @include_once ('language/' . $mosConfig_lang . '.php' ); 57 58 if( $database != NULL ) { 59 // get default frontend template 60 $query = "SELECT template" 61 . "\n FROM #__templates_menu" 62 . "\n WHERE client_id = 0" 63 . "\n AND menuid = 0" 64 ; 65 $database->setQuery( $query ); 66 $cur_template = $database->loadResult(); 67 $path = "$mosConfig_absolute_path/templates/$cur_template/index.php"; 68 if (!file_exists( $path )) { 69 $cur_template = 'rhuk_solarflare_ii'; 70 } 71 } else { 72 $cur_template = 'rhuk_solarflare_ii'; 73 } 74 75 // needed to seperate the ISO number from the language file constant _ISO 76 $iso = split( '=', _ISO ); 77 // xml prolog 78 echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>'; 79 ?> 80 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 81 <html xmlns="http://www.w3.org/1999/xhtml"> 82 <head> 83 <title><?php echo $mosConfig_sitename; ?> - Offline</title> 84 85 <link rel="stylesheet" href="<?php echo $mosConfig_live_site; ?>/templates/css/offline.css" type="text/css" /> 86 <?php 87 if ( file_exists("$mosConfig_absolute_path/templates/$cur_template/css/offline.css") ) { 88 ?> 89 <link rel="stylesheet" href="<?php echo $mosConfig_live_site; ?>/templates/<?php echo $cur_template; ?>/css/offline.css" type="text/css" /> 90 <?php 91 } 92 ?> 93 94 <?php 95 // favourites icon 96 if ( !$mosConfig_favicon ) { 97 $mosConfig_favicon = 'favicon.ico'; 98 } 99 $icon = $mosConfig_absolute_path .'/images/'. $mosConfig_favicon; 100 // checks to see if file exists 101 if ( !file_exists( $icon ) ) { 102 $icon = $mosConfig_live_site .'/images/favicon.ico'; 103 } else { 104 $icon = $mosConfig_live_site .'/images/' .$mosConfig_favicon; 105 } 106 ?> 107 <link rel="shortcut icon" href="<?php echo $icon; ?>" /> 108 <meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" /> 109 </head> 110 <body> 111 112 <p> </p> 113 <table width="550" align="center" class="outline"> 114 <tr> 115 <td width="60%" height="50" align="center"> 116 <img src="<?php echo $mosConfig_live_site; ?>/images/joomla_logo_black.jpg" alt="Joomla! Logo" align="middle" /> 117 </td> 118 </tr> 119 <tr> 120 <td align="center"> 121 <h1> 122 <?php echo $mosConfig_sitename; ?> 123 </h1> 124 </td> 125 </tr> 126 <?php 127 if ( $mosConfig_offline == 1 ) { 128 ?> 129 <tr> 130 <td width="39%" align="center"> 131 <h2> 132 <?php echo $mosConfig_offline_message; ?> 133 </h2> 134 </td> 135 </tr> 136 <?php 137 } else if (@$mosSystemError) { 138 ?> 139 <tr> 140 <td width="39%" align="center"> 141 <h2> 142 <?php echo $mosConfig_error_message; ?> 143 </h2> 144 <span class="err"><?php echo defined( '_SYSERR'.$mosSystemError ) ? constant( '_SYSERR'.$mosSystemError ) : $mosSystemError; ?></span> 145 </td> 146 </tr> 147 <?php 148 } else { 149 ?> 150 <tr> 151 <td width="39%" align="center"> 152 <h2> 153 <?php echo _INSTALL_WARN; ?> 154 </h2> 155 </td> 156 </tr> 157 <?php 158 } 159 ?> 160 </table> 161 162 </body> 163 </html> 164 <?php 165 exit( 0 ); 166 } 167 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Wed Nov 21 14:43:32 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |