[ Index ]
 

Code source de Joomla 1.0.13

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/installation/ -> index.php (source)

   1  <?php
   2  /**
   3  * @version $Id: index.php 7424 2007-05-17 15:56:10Z 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  // Set flag that this is a parent file
  15  define( '_VALID_MOS', 1 );
  16  
  17  if (file_exists( '../configuration.php' ) && filesize( '../configuration.php' ) > 10) {
  18      header( "Location: ../index.php" );
  19      exit();
  20  }
  21  require ( '../globals.php' );
  22  require_once ( '../includes/version.php' );
  23  
  24  /** Include common.php */
  25  include_once ( 'common.php' );
  26  view();
  27  
  28  /*
  29   * Added 1.0.11
  30   */
  31  function view() {
  32      $sp         = ini_get( 'session.save_path' );
  33  
  34      $_VERSION         = new joomlaVersion();
  35      $versioninfo     = $_VERSION->RELEASE .'.'. $_VERSION->DEV_LEVEL .' '. $_VERSION->DEV_STATUS;
  36      $version         = $_VERSION->PRODUCT .' '. $_VERSION->RELEASE .'.'. $_VERSION->DEV_LEVEL .' '. $_VERSION->DEV_STATUS.' [ '.$_VERSION->CODENAME .' ] '. $_VERSION->RELDATE .' '. $_VERSION->RELTIME .' '. $_VERSION->RELTZ;
  37  
  38      echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">";
  39      ?>
  40      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  41      <html xmlns="http://www.w3.org/1999/xhtml">
  42      <head>
  43      <title>Joomla! - Web Installer</title>
  44      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  45      <link rel="shortcut icon" href="../images/favicon.ico" />
  46      <link rel="stylesheet" href="install.css" type="text/css" />
  47      </head>
  48      <body>
  49  
  50      <div id="wrapper">
  51          <div id="header">
  52              <div id="joomla">
  53                  <img src="header_install.png" alt="Joomla! Installation" />
  54              </div>
  55          </div>
  56      </div>
  57  
  58      <div id="ctr" align="center">
  59          <div class="install">
  60              <div id="stepbar">
  61                  <div class="step-on">pre-installation check</div>
  62                  <div class="step-off">license</div>
  63                  <div class="step-off">step 1</div>
  64                  <div class="step-off">step 2</div>
  65                  <div class="step-off">step 3</div>
  66                  <div class="step-off">step 4</div>
  67              </div>
  68  
  69              <div id="right">
  70                  <div id="step">pre-installation check</div>
  71  
  72                  <div class="far-right">
  73                      <input name="Button2" type="submit" class="button" value="Next >>" onclick="window.location='install.php';" />
  74                      <br/>
  75                      <br/>
  76                      <input type="button" class="button" value="Check Again" onclick="window.location=window.location" />
  77                  </div>
  78                  <div class="clr"></div>
  79  
  80                  <h1 style="text-align: center; border-bottom: 0px;">
  81                      <?php echo $version; ?>
  82                  </h1>
  83  
  84                  <h1>
  85                      Required Settings Check:
  86                  </h1>
  87  
  88                  <div class="install-text">
  89                      <p>
  90                          If any of these items are highlighted in red then please take actions to correct them.
  91                      </p>
  92                      <p>
  93                          Failure to do so could lead to your Joomla! installation not functioning correctly.
  94                      </p>
  95                      <div class="ctr"></div>
  96                  </div>
  97  
  98                  <div class="install-form">
  99                      <div class="form-block">
 100                          <table class="content">
 101                          <tr>
 102                              <td class="item">
 103                                  PHP version >= 4.1.0
 104                              </td>
 105                              <td align="left">
 106                                  <?php echo phpversion() < '4.1' ? '<b><font color="red">No</font></b>' : '<b><font color="green">Yes</font></b>';?>
 107                              </td>
 108                          </tr>
 109                          <tr>
 110                              <td>
 111                                  &nbsp; - zlib compression support
 112                              </td>
 113                              <td align="left">
 114                                  <?php echo extension_loaded('zlib') ? '<b><font color="green">Available</font></b>' : '<b><font color="red">Unavailable</font></b>';?>
 115                              </td>
 116                          </tr>
 117                          <tr>
 118                              <td>
 119                                  &nbsp; - XML support
 120                              </td>
 121                              <td align="left">
 122                                  <?php echo extension_loaded('xml') ? '<b><font color="green">Available</font></b>' : '<b><font color="red">Unavailable</font></b>';?>
 123                              </td>
 124                          </tr>
 125                          <tr>
 126                              <td>
 127                                  &nbsp; - MySQL support
 128                              </td>
 129                              <td align="left">
 130                                  <?php echo function_exists( 'mysql_connect' ) ? '<b><font color="green">Available</font></b>' : '<b><font color="red">Unavailable</font></b>';?>
 131                              </td>
 132                          </tr>
 133                          <tr>
 134                              <td valign="top" class="item">
 135                                  configuration.php
 136                              </td>
 137                              <td align="left">
 138                                  <?php
 139                                  if (@file_exists('../configuration.php') &&  @is_writable( '../configuration.php' )){
 140                                      echo '<b><font color="green">Writeable</font></b>';
 141                                  } else if (is_writable( '..' )) {
 142                                      echo '<b><font color="green">Writeable</font></b>';
 143                                  } else {
 144                                      echo '<b><font color="red">Unwriteable</font></b><br /><span class="small">You can still continue the install as the configuration will be displayed at the end, just copy & paste this and upload.</span>';
 145                                  }
 146                                  ?>
 147                              </td>
 148                          </tr>
 149                          <tr>
 150                              <td class="item">
 151                                  Session save path
 152                              </td>
 153                              <td align="left" valign="top">
 154                                  <?php echo is_writable( $sp ) ? '<b><font color="green">Writeable</font></b>' : '<b><font color="red">Unwriteable</font></b>';?>
 155                              </td>
 156                          </tr>
 157                          <tr>
 158                              <td class="item" colspan="2">
 159                                  <b>
 160                                      <?php echo $sp ? $sp : 'Not set'; ?>
 161                                  </b>
 162                              </td>
 163                          </tr>
 164                          </table>
 165                      </div>
 166                  </div>
 167                  <div class="clr"></div>
 168  
 169                  <?php
 170                  $wrongSettingsTexts = array();
 171  
 172                  if ( ini_get('magic_quotes_gpc') != '1' ) {
 173                      $wrongSettingsTexts[] = 'PHP magic_quotes_gpc setting is `OFF` instead of `ON`';
 174                  }
 175                  if ( ini_get('register_globals') == '1' ) {
 176                      $wrongSettingsTexts[] = 'PHP register_globals setting is `ON` instead of `OFF`';
 177                  }
 178  
 179                  if ( count($wrongSettingsTexts) ) {
 180                      ?>
 181                      <h1>
 182                          Security Check:
 183                      </h1>
 184  
 185                      <div class="install-text">
 186                          <p>
 187                              Following PHP Server Settings are not optimal for <strong>Security</strong> and it is recommended to change them:
 188                          </p>
 189                          <p>
 190                              Please check <a href="http://forum.joomla.org/index.php/topic,81058.0.html" target="_blank">the Official Joomla! Server Security post</a> for more information.
 191                          </p>
 192                          <div class="ctr"></div>
 193                      </div>
 194  
 195                      <div class="install-form">
 196                          <div class="form-block" style=" border: 1px solid #cc0000; background: #ffffcc;">
 197                              <table class="content">
 198                              <tr>
 199                                  <td class="item">
 200                                      <ul style="margin: 0px; padding: 0px; padding-left: 5px; text-align: left; padding-bottom: 0px; list-style: none;">
 201                                          <?php
 202                                          foreach ($wrongSettingsTexts as $txt) {
 203                                              ?>
 204                                              <li style="min-height: 25px; padding-bottom: 5px; padding-left: 25px; color: red; font-weight: bold; background-image: url(../includes/js/ThemeOffice/warning.png); background-repeat: no-repeat; background-position: 0px 2px;" >
 205                                                  <?php
 206                                                  echo $txt;
 207                                                  ?>
 208                                              </li>
 209                                              <?php
 210                                          }
 211                                          ?>
 212                                      </ul>
 213                                  </td>
 214                              </tr>
 215                              </table>
 216                          </div>
 217                      </div>
 218                      <div class="clr"></div>
 219                      <?php
 220                  }
 221                  ?>
 222  
 223                  <h1>
 224                      Recommended Settings Check:
 225                  </h1>
 226  
 227                  <div class="install-text">
 228                      <p>
 229                          These settings are recommended for PHP in order to ensure full
 230                          compatibility with Joomla!.
 231                      </p>
 232                      <p>
 233                          However, Joomla! will still operate if your settings do not quite match the recommended
 234                      </p>
 235                      <div class="ctr"></div>
 236                  </div>
 237  
 238                  <div class="install-form">
 239                      <div class="form-block">
 240  
 241                          <table class="content">
 242                          <tr>
 243                              <td class="toggle" width="500px">
 244                                  Directive
 245                              </td>
 246                              <td class="toggle">
 247                                  Recommended
 248                              </td>
 249                              <td class="toggle">
 250                                  Actual
 251                              </td>
 252                          </tr>
 253                          <?php
 254                          $php_recommended_settings = array(array ('Safe Mode','safe_mode','OFF'),
 255                              array ('Display Errors','display_errors','ON'),
 256                              array ('File Uploads','file_uploads','ON'),
 257                              array ('Magic Quotes GPC','magic_quotes_gpc','ON'),
 258                              array ('Magic Quotes Runtime','magic_quotes_runtime','OFF'),
 259                              array ('Register Globals','register_globals','OFF'),
 260                              array ('Output Buffering','output_buffering','OFF'),
 261                              array ('Session auto start','session.auto_start','OFF'),
 262                          );
 263  
 264                          foreach ($php_recommended_settings as $phprec) {
 265                              ?>
 266                              <tr>
 267                                  <td class="item">
 268                                      <?php echo $phprec[0]; ?>:
 269                                  </td>
 270                                  <td class="toggle">
 271                                      <?php echo $phprec[2]; ?>:
 272                                  </td>
 273                                  <td>
 274                                      <b>
 275                                          <?php
 276                                          if ( get_php_setting($phprec[1]) == $phprec[2] ) {
 277                                              ?>
 278                                              <font color="green">
 279                                              <?php
 280                                          } else {
 281                                              ?>
 282                                              <font color="red">
 283                                              <?php
 284                                          }
 285                                          echo get_php_setting($phprec[1]);
 286                                          ?>
 287                                          </font>
 288                                      </b>
 289                                  <td>
 290                              </tr>
 291                              <?php
 292                          }
 293                          ?>
 294                          </table>
 295                      </div>
 296                  </div>
 297                  <div class="clr"></div>
 298  
 299                  <h1>
 300                      Directory and File Permissions Check:
 301                  </h1>
 302  
 303                  <div class="install-text">
 304                      <p>
 305                          In order for Joomla! to function correctly it needs to be able to access or write to certain files or directories.
 306                      </p>
 307                      <p>
 308                          If you see "Unwriteable" you need to change the permissions on the file or directory to allow Joomla! to write to it.
 309                      </p>
 310                      <div class="clr">&nbsp;&nbsp;</div>
 311                      <div class="ctr"></div>
 312                  </div>
 313  
 314                  <div class="install-form">
 315                      <div class="form-block">
 316                          <table class="content">
 317                          <?php
 318                          writableCell( 'administrator/backups' );
 319                          writableCell( 'administrator/components' );
 320                          writableCell( 'administrator/modules' );
 321                          writableCell( 'administrator/templates' );
 322                          writableCell( 'cache' );
 323                          writableCell( 'components' );
 324                          writableCell( 'images' );
 325                          writableCell( 'images/banners' );
 326                          writableCell( 'images/stories' );
 327                          writableCell( 'language' );
 328                          writableCell( 'mambots' );
 329                          writableCell( 'mambots/content' );
 330                          writableCell( 'mambots/editors' );
 331                          writableCell( 'mambots/editors-xtd' );
 332                          writableCell( 'mambots/search' );
 333                          writableCell( 'mambots/system' );
 334                          writableCell( 'media' );
 335                          writableCell( 'modules' );
 336                          writableCell( 'templates' );
 337                          ?>
 338                          </table>
 339                      </div>
 340                      <div class="clr"></div>
 341                  </div>
 342  
 343  
 344                  <div class="clr"></div>
 345              </div>
 346              <div class="clr"></div>
 347          </div>
 348      </div>
 349  
 350      <div class="ctr">
 351          <a href="http://www.joomla.org" target="_blank">Joomla!</a> is Free Software released under the GNU/GPL License.
 352      </div>
 353  
 354      </body>
 355      </html>
 356      <?php
 357  }
 358  
 359  function get_php_setting($val) {
 360      $r =  (ini_get($val) == '1' ? 1 : 0);
 361      return $r ? 'ON' : 'OFF';
 362  }
 363  
 364  function writableCell( $folder, $relative=1, $text='' ) {
 365      $writeable         = '<b><font color="green">Writeable</font></b>';
 366      $unwriteable     = '<b><font color="red">Unwriteable</font></b>';
 367  
 368      echo '<tr>';
 369      echo '<td class="item">' . $folder . '/</td>';
 370      echo '<td align="right">';
 371      if ( $relative ) {
 372          echo is_writable( "../$folder" )     ? $writeable : $unwriteable;
 373      } else {
 374          echo is_writable( "$folder" )         ? $writeable : $unwriteable;
 375      }
 376      echo '</tr>';
 377  }
 378  ?>


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