install/index.php
changeset 1227 bdac73ed481e
parent 1081 745200a9cc2a
child 1259 49db7495f6b8
equal deleted inserted replaced
1226:de56132c008d 1227:bdac73ed481e
    16 require_once('includes/common.php');
    16 require_once('includes/common.php');
    17 
    17 
    18 $ui = new Enano_Installer_UI('Enano installation', true);
    18 $ui = new Enano_Installer_UI('Enano installation', true);
    19 if ( version_compare(PHP_VERSION, '5.0.0', '<') )
    19 if ( version_compare(PHP_VERSION, '5.0.0', '<') )
    20 {
    20 {
    21   $ui->__construct('Enano installation', true);
    21 	$ui->__construct('Enano installation', true);
    22 }
    22 }
    23 $ui->add_stage('Welcome', true);
    23 $ui->add_stage('Welcome', true);
    24 $ui->add_stage('Installation', true);
    24 $ui->add_stage('Installation', true);
    25 $ui->add_stage('Upgrade', true);
    25 $ui->add_stage('Upgrade', true);
    26 $ui->add_stage('Readme', true);
    26 $ui->add_stage('Readme', true);
    27 
    27 
    28 $ui->show_header();
    28 $ui->show_header();
    29 
    29 
    30 if ( defined('ENANO_INSTALLED') )
    30 if ( defined('ENANO_INSTALLED') )
    31 {
    31 {
    32   // Is Enano installed? If so, load the config and check version info
    32 	// Is Enano installed? If so, load the config and check version info
    33   define('IN_ENANO_UPGRADE', 'true');
    33 	define('IN_ENANO_UPGRADE', 'true');
    34   define('ENANO_EXIT_AFTER_CONFIG', 1);
    34 	define('ENANO_EXIT_AFTER_CONFIG', 1);
    35   // common.php above calls chdir() to the ENANO_ROOT, so this loads the full Enano API.
    35 	// common.php above calls chdir() to the ENANO_ROOT, so this loads the full Enano API.
    36   require('includes/common.php');
    36 	require('includes/common.php');
    37 }
    37 }
    38 
    38 
    39 // are we in PHP5?
    39 // are we in PHP5?
    40 define('HAVE_PHP5', version_compare(PHP_VERSION, '5.0.0', '>='));
    40 define('HAVE_PHP5', version_compare(PHP_VERSION, '5.0.0', '>='));
    41 
    41 
    42 ?>
    42 ?>
    43 
    43 
    44           <div id="installnotice">
    44 					<div id="installnotice">
    45           <?php
    45 					<?php
    46             if ( !defined('ENANO_INSTALLED') ):
    46 						if ( !defined('ENANO_INSTALLED') ):
    47             ?>
    47 						?>
    48             <div class="info-box-mini">
    48 						<div class="info-box-mini">
    49               <b>Enano hasn't been installed yet!</b><br />
    49 							<b>Enano hasn't been installed yet!</b><br />
    50               You'll need to install the Enano database before you can use your site. To get started, click the Install button below.
    50 							You'll need to install the Enano database before you can use your site. To get started, click the Install button below.
    51             </div>
    51 						</div>
    52           <?php
    52 					<?php
    53             if ( file_exists('./config.php') )
    53 						if ( file_exists('./config.php') )
    54             {
    54 						{
    55             ?>
    55 						?>
    56             <div class="warning-box-mini">
    56 						<div class="warning-box-mini">
    57               <b>A configuration file (config.php) exists but doesn't set the ENANO_INSTALLED constant.</b><br />
    57 							<b>A configuration file (config.php) exists but doesn't set the ENANO_INSTALLED constant.</b><br />
    58               <p>Didn't expect to see this message?
    58 							<p>Didn't expect to see this message?
    59               It's possible that your configuration file has become corrupted and no longer sets information that Enano needs to connect
    59 							It's possible that your configuration file has become corrupted and no longer sets information that Enano needs to connect
    60               to the database. You should have a look at your config.php by downloading it with FTP or viewing it over SSH.
    60 							to the database. You should have a look at your config.php by downloading it with FTP or viewing it over SSH.
    61               If the file appears to have been tampered with, please <a href="http://forum.enanocms.org/">contact the Enano team</a>
    61 							If the file appears to have been tampered with, please <a href="http://forum.enanocms.org/">contact the Enano team</a>
    62               for support immediately.</p>
    62 							for support immediately.</p>
    63               <p><b>Most importantly, if you suspect a security breach, you should contact the Enano team
    63 							<p><b>Most importantly, if you suspect a security breach, you should contact the Enano team
    64                  <a href="http://enanocms.org/Contact_us">via e-mail</a>. If you have the capability to use PGP encryption, you should do
    64  								<a href="http://enanocms.org/Contact_us">via e-mail</a>. If you have the capability to use PGP encryption, you should do
    65                  so; our public key is available <a href="http://enanocms.org/bin/enanocms-signkey.asc">here</a>.</b></p>
    65  								so; our public key is available <a href="http://enanocms.org/bin/enanocms-signkey.asc">here</a>.</b></p>
    66             </div>
    66 						</div>
    67             <?php
    67 						<?php
    68             }
    68 						}
    69             endif;
    69 						endif;
    70             ?></div>
    70 						?></div>
    71           <table border="0" cellspacing="10" cellpadding="0" width="100%" id="installmenu">
    71 					<table border="0" cellspacing="10" cellpadding="0" width="100%" id="installmenu">
    72             <tr>
    72 						<tr>
    73               <td style="text-align: right; width: 50%;">
    73 							<td style="text-align: right; width: 50%;">
    74                 <!-- Enano logo -->
    74 								<!-- Enano logo -->
    75                 <img alt="Enano CMS" src="images/enano-artwork/installer-greeting.png" />
    75 								<img alt="Enano CMS" src="images/enano-artwork/installer-greeting.png" />
    76               </td>
    76 							</td>
    77               <td class="balancer">
    77 							<td class="balancer">
    78               </td>
    78 							</td>
    79               <td>
    79 							<td>
    80                 <ul class="icons">
    80 								<ul class="icons">
    81                   <li><a href="readme.php" class="readme icon">Readme</a></li>
    81 									<li><a href="readme.php" class="readme icon">Readme</a></li>
    82 <?php
    82 <?php
    83                   if ( !defined('ENANO_INSTALLED') ):
    83 									if ( !defined('ENANO_INSTALLED') ):
    84                   ?>
    84 									?>
    85                   <li><a href="install.php" class="install icon">Install</a></li>
    85 									<li><a href="install.php" class="install icon">Install</a></li>
    86                   <li>
    86 									<li>
    87                     <a class="upgrade-disabled icon icon-disabled" title="You need to install Enano before you can do this.">
    87 										<a class="upgrade-disabled icon icon-disabled" title="You need to install Enano before you can do this.">
    88                       Upgrade
    88 											Upgrade
    89                       <small>
    89 											<small>
    90                         Enano isn't installed yet. You can use this option when you want to upgrade to a newer release of Enano.
    90 												Enano isn't installed yet. You can use this option when you want to upgrade to a newer release of Enano.
    91                       </small>
    91 											</small>
    92                     </a>
    92 										</a>
    93                   </li>
    93 									</li>
    94 <?php
    94 <?php
    95                   else:
    95 									else:
    96                   ?>
    96 									?>
    97                   <li>
    97 									<li>
    98                     <a class="install-disabled icon icon-disabled" title="Enano is already installed.">
    98 										<a class="install-disabled icon icon-disabled" title="Enano is already installed.">
    99                       Install
    99 											Install
   100                       <small>Enano is already installed.</small> <!-- CSS takes care of making this position properly -->
   100 											<small>Enano is already installed.</small> <!-- CSS takes care of making this position properly -->
   101                     </a>
   101 										</a>
   102                   </li>
   102 									</li>
   103                   <?php
   103 									<?php
   104                   if ( installer_enano_version() == enano_version(true) )
   104 									if ( installer_enano_version() == enano_version(true) )
   105                   {
   105 									{
   106                     echo '<li>
   106 										echo '<li>
   107                     <a class="upgrade-disabled icon icon-disabled">
   107 										<a class="upgrade-disabled icon icon-disabled">
   108                       Upgrade
   108 											Upgrade
   109                       <small>
   109 											<small>
   110                         You\'re already running the version of Enano included in this installer. Use the administration panel to check
   110 												You\'re already running the version of Enano included in this installer. Use the administration panel to check
   111                         for updates.
   111 												for updates.
   112                       </small> <!-- CSS takes care of making this position properly -->
   112 											</small> <!-- CSS takes care of making this position properly -->
   113                     </a>
   113 										</a>
   114                   </li>';
   114 									</li>';
   115                   }
   115 									}
   116                   else
   116 									else
   117                   {
   117 									{
   118                     $upgrade_script = file_exists('./install/onlineupgrade.php') ? 'onlineupgrade.php' : 'upgrade.php';
   118 										$upgrade_script = file_exists('./install/onlineupgrade.php') ? 'onlineupgrade.php' : 'upgrade.php';
   119                     if ( HAVE_PHP5 && !isset($_GET['debug_warn_php4']) )
   119 										if ( HAVE_PHP5 && !isset($_GET['debug_warn_php4']) )
   120                       echo '<li><a href="' . $upgrade_script . '" class="upgrade icon">Upgrade</a></li>';
   120 											echo '<li><a href="' . $upgrade_script . '" class="upgrade icon">Upgrade</a></li>';
   121                     else
   121 										else
   122                       echo '<li>
   122 											echo '<li>
   123                     <span class="upgrade-disabled icon icon-disabled">
   123 										<span class="upgrade-disabled icon icon-disabled">
   124                       Upgrade
   124 											Upgrade
   125                       <small>
   125 											<small>
   126                         Your server doesn\'t have PHP 5 or later installed. Enano 1.2 does not have support for PHP 4.
   126 												Your server doesn\'t have PHP 5 or later installed. Enano 1.2 does not have support for PHP 4.
   127                         <a href="install.php?debug_warn_php4">Learn more &raquo;</a>
   127 												<a href="install.php?debug_warn_php4">Learn more &raquo;</a>
   128                       </small> <!-- CSS takes care of making this position properly -->
   128 											</small> <!-- CSS takes care of making this position properly -->
   129                     </span>
   129 										</span>
   130                   </li>';
   130 									</li>';
   131                   }
   131 									}
   132                   endif;
   132 									endif;
   133                   ?>
   133 									?>
   134                 
   134 								
   135                 </ul>
   135 								</ul>
   136               </td>
   136 							</td>
   137             </tr>
   137 						</tr>
   138           </table>
   138 					</table>
   139 
   139 
   140 <?php
   140 <?php
   141 
   141 
   142 $ui->show_footer();
   142 $ui->show_footer();
   143 
   143