install.php
changeset 16 64e0d3d4cf14
parent 13 fdd6b9dd42c3
child 21 663fcf528726
equal deleted inserted replaced
15:ad5986a53197 16:64e0d3d4cf14
     1 <?php
     1 <?php
     2 /*
     2 /*
     3  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
     3  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
     4  * Version 1.0 (Banshee)
     4  * Version 1.0 release candidate 3 (Druid)
     5  * Copyright (C) 2006-2007 Dan Fuhry
     5  * Copyright (C) 2006-2007 Dan Fuhry
     6  * install.php - handles everything related to installation and initial configuration
     6  * install.php - handles everything related to installation and initial configuration
     7  *
     7  *
     8  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
     8  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
     9  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
     9  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
    21 }
    21 }
    22 
    22 
    23 define('IN_ENANO_INSTALL', 'true');
    23 define('IN_ENANO_INSTALL', 'true');
    24 
    24 
    25 define('ENANO_VERSION', '1.0');
    25 define('ENANO_VERSION', '1.0');
       
    26 define('ENANO_BETA_VERSION', '3'); // This is really RC
    26 // In beta versions, define ENANO_BETA_VERSION here
    27 // In beta versions, define ENANO_BETA_VERSION here
    27 
    28 
    28 if(!defined('scriptPath')) {
    29 if(!defined('scriptPath')) {
    29   $sp = dirname($_SERVER['REQUEST_URI']);
    30   $sp = dirname($_SERVER['REQUEST_URI']);
    30   if($sp == '/' || $sp == '\\') $sp = '';
    31   if($sp == '/' || $sp == '\\') $sp = '';
   255   default:
   256   default:
   256     break;
   257     break;
   257 }
   258 }
   258 
   259 
   259 $template = new template_nodb();
   260 $template = new template_nodb();
   260 $template->load_theme('oxygen', 'bleu', false);
   261 $template->load_theme('stpatty', 'shamrock', false);
   261 
   262 
   262 $modestrings = Array(
   263 $modestrings = Array(
   263               'welcome' => 'Welcome',
   264               'welcome' => 'Welcome',
   264               'license' => 'License Agreement',
   265               'license' => 'License Agreement',
   265               'sysreqs' => 'Server requirements',
   266               'sysreqs' => 'Server requirements',
   310   case 'welcome':
   311   case 'welcome':
   311     ?>
   312     ?>
   312     <div style="text-align: center; margin-top: 10px;">
   313     <div style="text-align: center; margin-top: 10px;">
   313       <img alt="[ Enano CMS Project logo ]" src="images/enano-artwork/installer-greeting-blue.png" style="display: block; margin: 0 auto; padding-left: 100px;" />
   314       <img alt="[ Enano CMS Project logo ]" src="images/enano-artwork/installer-greeting-blue.png" style="display: block; margin: 0 auto; padding-left: 100px;" />
   314       <h2>Welcome to Enano</h2>
   315       <h2>Welcome to Enano</h2>
   315       <h3>version 1.0 &ndash; stable<br />
   316       <h3>version 1.0rc3 &ndash; security release<br />
   316       <span style="font-weight: normal;">also affectionately known as "banshee" <tt>:)</tt></span></h3>
   317       <span style="font-weight: normal;">also affectionately known as "druid" <tt>:)</tt></span></h3>
   317       <?php
   318       <?php
   318       if ( file_exists('./_nightly.php') )
   319       if ( file_exists('./_nightly.php') )
   319       {
   320       {
   320         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>';
   321         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>';
   321       }
   322       }
  1039       $schema = str_replace('{{ENABLE_CACHE}}', mysql_real_escape_string($cacheonoff          ), $schema);
  1040       $schema = str_replace('{{ENABLE_CACHE}}', mysql_real_escape_string($cacheonoff          ), $schema);
  1040       $schema = str_replace('{{REAL_NAME}}',    '',                                              $schema);
  1041       $schema = str_replace('{{REAL_NAME}}',    '',                                              $schema);
  1041       $schema = str_replace('{{TABLE_PREFIX}}', $_POST['table_prefix'],                          $schema);
  1042       $schema = str_replace('{{TABLE_PREFIX}}', $_POST['table_prefix'],                          $schema);
  1042       $schema = str_replace('{{VERSION}}',      ENANO_VERSION,                                   $schema);
  1043       $schema = str_replace('{{VERSION}}',      ENANO_VERSION,                                   $schema);
  1043       $schema = str_replace('{{ADMIN_EMBED_PHP}}', $_POST['admin_embed_php'],                    $schema);
  1044       $schema = str_replace('{{ADMIN_EMBED_PHP}}', $_POST['admin_embed_php'],                    $schema);
  1044       // Not anymore! :-D
  1045       $schema = str_replace('{{BETA_VERSION}}', ENANO_BETA_VERSION,                              $schema);
  1045       // $schema = str_replace('{{BETA_VERSION}}', ENANO_BETA_VERSION,                              $schema);
       
  1046       
  1046       
  1047       if(isset($_POST['wiki_mode'])) $schema = str_replace('{{WIKI_MODE}}', '1', $schema);
  1047       if(isset($_POST['wiki_mode'])) $schema = str_replace('{{WIKI_MODE}}', '1', $schema);
  1048       else $schema = str_replace('{{WIKI_MODE}}', '0', $schema);
  1048       else $schema = str_replace('{{WIKI_MODE}}', '0', $schema);
  1049       
  1049       
  1050       // Build an array of queries      
  1050       // Build an array of queries