install.php
changeset 229 97ae8e9d5e29
parent 227 0eca1498a77b
child 231 b11a2f1353c0
equal deleted inserted replaced
147:d8156d18ac58 229:97ae8e9d5e29
     1 <?php
     1 <?php
     2 
     2 
     3 /*
     3 /*
     4  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
     4  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
     5  * Version 1.0.2 (Coblynau)
     5  * Version 1.1.1
     6  * Copyright (C) 2006-2007 Dan Fuhry
     6  * Copyright (C) 2006-2007 Dan Fuhry
     7  * install.php - handles everything related to installation and initial configuration
     7  * install.php - handles everything related to installation and initial configuration
     8  *
     8  *
     9  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
     9  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
    10  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
    10  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
    12  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
    12  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
    13  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
    13  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
    14  */
    14  */
    15  
    15  
    16 @include('config.php');
    16 @include('config.php');
    17 if( ( defined('ENANO_INSTALLED') || defined('MIDGET_INSTALLED') ) && ((isset($_GET['mode']) && ($_GET['mode']!='finish' && $_GET['mode']!='css')) || !isset($_GET['mode']))) {
    17 if( ( defined('ENANO_INSTALLED') || defined('MIDGET_INSTALLED') ) && ((isset($_GET['mode']) && ($_GET['mode']!='finish' && $_GET['mode']!='css')) || !isset($_GET['mode'])))
    18   $_GET['title'] = 'Enano:WhoCaresWhatThisIs';
    18 {
       
    19   $_GET['title'] = 'Enano:Installation_locked';
    19   require('includes/common.php');
    20   require('includes/common.php');
    20   die_friendly('Installation locked', '<p>The Enano installer has found a Enano installation in this directory. You MUST delete config.php if you want to re-install Enano.</p><p>If you wish to upgrade an older Enano installation to this version, please use the <a href="upgrade.php">upgrade script</a>.</p>');
    21   die_friendly('Installation locked', '<p>The Enano installer has found a Enano installation in this directory. You MUST delete config.php if you want to re-install Enano.</p><p>If you wish to upgrade an older Enano installation to this version, please use the <a href="upgrade.php">upgrade script</a>.</p>');
    21   exit;
    22   exit;
    22 }
    23 }
    23 
    24 
    24 define('IN_ENANO_INSTALL', 'true');
    25 define('IN_ENANO_INSTALL', 'true');
    25 
    26 
    26 define('ENANO_VERSION', '1.0.2');
    27 define('ENANO_VERSION', '1.1.1');
    27 // In beta versions, define ENANO_BETA_VERSION here
    28 // In beta versions, define ENANO_BETA_VERSION here
    28 define('ENANO_BETA_VERSION', '1');
       
    29 
    29 
    30 if(!defined('scriptPath')) {
    30 if(!defined('scriptPath')) {
    31   $sp = dirname($_SERVER['REQUEST_URI']);
    31   $sp = dirname($_SERVER['REQUEST_URI']);
    32   if($sp == '/' || $sp == '\\') $sp = '';
    32   if($sp == '/' || $sp == '\\') $sp = '';
    33   define('scriptPath', $sp);
    33   define('scriptPath', $sp);
   314   case 'welcome':
   314   case 'welcome':
   315     ?>
   315     ?>
   316     <div style="text-align: center; margin-top: 10px;">
   316     <div style="text-align: center; margin-top: 10px;">
   317       <img alt="[ Enano CMS Project logo ]" src="images/enano-artwork/installer-greeting-green.png" style="display: block; margin: 0 auto; padding-left: 100px;" />
   317       <img alt="[ Enano CMS Project logo ]" src="images/enano-artwork/installer-greeting-green.png" style="display: block; margin: 0 auto; padding-left: 100px;" />
   318       <h2>Welcome to Enano</h2>
   318       <h2>Welcome to Enano</h2>
   319       <h3>version 1.0.2 &ndash; beta 1<br />
   319       <h3>version 1.1.1 &ndash; unstable</h3>
   320       <span style="font-weight: normal;">also affectionately known as "coblynau" <tt>:)</tt></span></h3>
       
   321       <?php
   320       <?php
   322       if ( file_exists('./_nightly.php') )
   321       if ( file_exists('./_nightly.php') )
   323       {
   322       {
   324         echo '<div class="warning-box" style="text-align: left; margin: 10px 0;"><b>You are about to install a NIGHTLY BUILD of Enano.</b><br />Nightly builds are NOT upgradeable and may contain serious flaws, security problems, or extraneous debugging information. Installing this version of Enano on a production site is NOT recommended.</div>';
   323         echo '<div class="warning-box" style="text-align: left; margin: 10px 0;"><b>You are about to install a NIGHTLY BUILD of Enano.</b><br />Nightly builds are NOT upgradeable and may contain serious flaws, security problems, or extraneous debugging information. Installing this version of Enano on a production site is NOT recommended.</div>';
   325       }
   324       }
  1064       $schema = str_replace('{{ENABLE_CACHE}}', mysql_real_escape_string($cacheonoff          ), $schema);
  1063       $schema = str_replace('{{ENABLE_CACHE}}', mysql_real_escape_string($cacheonoff          ), $schema);
  1065       $schema = str_replace('{{REAL_NAME}}',    '',                                              $schema);
  1064       $schema = str_replace('{{REAL_NAME}}',    '',                                              $schema);
  1066       $schema = str_replace('{{TABLE_PREFIX}}', $_POST['table_prefix'],                          $schema);
  1065       $schema = str_replace('{{TABLE_PREFIX}}', $_POST['table_prefix'],                          $schema);
  1067       $schema = str_replace('{{VERSION}}',      ENANO_VERSION,                                   $schema);
  1066       $schema = str_replace('{{VERSION}}',      ENANO_VERSION,                                   $schema);
  1068       $schema = str_replace('{{ADMIN_EMBED_PHP}}', $_POST['admin_embed_php'],                    $schema);
  1067       $schema = str_replace('{{ADMIN_EMBED_PHP}}', $_POST['admin_embed_php'],                    $schema);
  1069       $schema = str_replace('{{BETA_VERSION}}', ENANO_BETA_VERSION,                              $schema);
  1068       // Not anymore!! :-D
       
  1069       // $schema = str_replace('{{BETA_VERSION}}', ENANO_BETA_VERSION,                              $schema);
  1070       
  1070       
  1071       if(isset($_POST['wiki_mode']))
  1071       if(isset($_POST['wiki_mode']))
  1072       {
  1072       {
  1073         $schema = str_replace('{{WIKI_MODE}}', '1', $schema);
  1073         $schema = str_replace('{{WIKI_MODE}}', '1', $schema);
  1074       }
  1074       }