install.php
changeset 222 acfdccf7a2bf
parent 218 e0ec986c0af3
child 225 90632c09ed7e
equal deleted inserted replaced
221:956263992d48 222:acfdccf7a2bf
    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') && $_GET['mode']!='showlicense') || !isset($_GET['mode'])))
    18 {
    18 {
    19   $_GET['title'] = 'Enano:Installation_locked';
    19   $_GET['title'] = 'Enano:Installation_locked';
    20   require('includes/common.php');
    20   require('includes/common.php');
    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   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>');
    22   exit;
    22   exit;
   680     echo "<tr><td style='background-color: #$color; width: 500px;'>$desc<br /><b>$extended_desc</b></td><td style='padding-left: 10px;'><img alt='Test failed' src='images/bad.gif' /></td></tr>";
   680     echo "<tr><td style='background-color: #$color; width: 500px;'>$desc<br /><b>$extended_desc</b></td><td style='padding-left: 10px;'><img alt='Test failed' src='images/bad.gif' /></td></tr>";
   681     $failed = true;
   681     $failed = true;
   682   }
   682   }
   683 }
   683 }
   684 function is_apache() { $r = strstr($_SERVER['SERVER_SOFTWARE'], 'Apache') ? true : false; return $r; }
   684 function is_apache() { $r = strstr($_SERVER['SERVER_SOFTWARE'], 'Apache') ? true : false; return $r; }
       
   685 
       
   686 function show_license($fb = false)
       
   687 {
       
   688   ?>
       
   689   <div style="height: 500px; clip: rect(0px,auto,500px,auto); overflow: auto; padding: 10px; border: 1px dashed #456798; margin: 1em;">
       
   690    <h2>GNU General Public License</h2>
       
   691    
       
   692    <h3>Declaration of license usage</h3>
       
   693    <p>Enano is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.</p>
       
   694    <p>This program is distributed in the hope that it will be useful, but <u>without any warranty</u>; without even the implied warranty of <u>merchantability</u> or <u>fitness for a particular purpose</u>. See the GNU General Public License (below) for more details.</p>
       
   695    <p><b>By clicking the button below or otherwise continuing the installation, you indicate your acceptance of this license agreement.</b></p>
       
   696    
       
   697    <h3>Human-readable version</h3>
       
   698    <p>Enano is distributed under certain licensing terms that we believe make it of the greatest possible use to the public. The license we distribute it under, the GNU General Public License, provides certain terms and conditions that, rather than limit your use of Enano, allow you to get the most out of it. If you would like to read the full text, it can be found below. Here is a human-readable version that we think is a little easier to understand.</p>
       
   699    
       
   700    <ul>
       
   701      <li>You may to run Enano for any purpose.</li>
       
   702      <li>You may study how Enano works and adapt it to your needs.</li>
       
   703      <li>You may redistribute copies so you can help your neighbor.</li>
       
   704      <li>You may improve Enano and release your improvements to the public, so that the whole community benefits.</li>
       
   705    </ul>
       
   706    
       
   707    <p>You may exercise the freedoms specified here provided that you comply with the express conditions of this license. The principal conditions are:</p>
       
   708    
       
   709    <ul>
       
   710      <li>You must conspicuously and appropriately publish on each copy distributed an appropriate copyright notice and disclaimer of warranty and keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of Enano a copy of the GNU General Public License along with Enano. Any translation of the GNU General Public License must be accompanied by the GNU General Public License.</li>
       
   711      <li>If you modify your copy or copies of Enano or any portion of it, or develop a program based upon it, you may distribute the resulting work provided you do so under the GNU General Public License. Any translation of the GNU General Public License must be accompanied by the GNU General Public License.</li>
       
   712      <li>If you copy or distribute Enano, you must accompany it with the complete corresponding machine-readable source code or with a written offer, valid for at least three years, to furnish the complete corresponding machine-readable source code.</li>
       
   713    </ul>
       
   714    
       
   715    <p><b>Disclaimer</b>: The above text is not a license. It is simply a handy reference for understanding the Legal Code (the full license) &ndash; it is a human-readable expression of some of its key terms. Think of it as the user-friendly interface to the Legal Code beneath. The above text itself has no legal value, and its contents do not appear in the actual license.<br /><span style="color: #CCC">Text copied from the <a href="http://creativecommons.org/licenses/GPL/2.0/">Creative Commons GPL Deed page</a></span></p>
       
   716    <?php
       
   717    if ( defined('ENANO_BETA_VERSION') )
       
   718    {
       
   719      ?>
       
   720      <h3>Notice for prerelease versions</h3>
       
   721      <p>This version of Enano is designed only for testing and evaluation purposes. <b>It is not yet completely stable, and should not be used on production websites.</b> As with any Enano version, Dan Fuhry and the Enano team cannot be responsible for any damage, physical or otherwise, to any property as a result of the use of Enano. While security is a number one priority, sometimes things slip through.</p>
       
   722      <?php
       
   723    }
       
   724    ?>
       
   725    <h3>Lawyer-readable version</h3>
       
   726    <?php echo wikiFormat(file_get_contents(ENANO_ROOT . '/GPL')); ?>
       
   727    <?php
       
   728    global $template;
       
   729    if ( $fb )
       
   730    {
       
   731      echo '<p style="text-align: center;">Because I could never find the Create a Page button in PHP-Nuke.</p>';
       
   732      echo '<p>' . str_replace('http://enanocms.org/', 'http://www.2robots.com/2003/10/15/web-portals-suck/', $template->fading_button) . '</p>';
       
   733      echo '<p style="text-align: center;">It\'s not a portal, my friends.</p>';
       
   734    }
       
   735    ?>
       
   736  </div>
       
   737  <?php
       
   738 }
   685 
   739 
   686 require_once('includes/template.php');
   740 require_once('includes/template.php');
   687 
   741 
   688 if(!isset($_GET['mode'])) $_GET['mode'] = 'welcome';
   742 if(!isset($_GET['mode'])) $_GET['mode'] = 'welcome';
   689 switch($_GET['mode'])
   743 switch($_GET['mode'])
   829               'database'=> 'Database information',
   883               'database'=> 'Database information',
   830               'website' => 'Website configuration',
   884               'website' => 'Website configuration',
   831               'login'   => 'Administration login',
   885               'login'   => 'Administration login',
   832               'confirm' => 'Confirm installation',
   886               'confirm' => 'Confirm installation',
   833               'install' => 'Database installation',
   887               'install' => 'Database installation',
   834               'finish'  => 'Installation complete'
   888               'finish'  => 'Installation complete',
       
   889               '_hiddenstages' => '...', // all stages below this line are hidden
       
   890               'showlicense' => 'License Agreement'
   835             );
   891             );
   836 
   892 
   837 $sideinfo = '';
   893 $sideinfo = '';
   838 $vars = $template->extract_vars('elements.tpl');
   894 $vars = $template->extract_vars('elements.tpl');
   839 $p = $template->makeParserText($vars['sidebar_button']);
   895 $p = $template->makeParserText($vars['sidebar_button']);
       
   896 $hidden = false;
   840 foreach ( $modestrings as $id => $str )
   897 foreach ( $modestrings as $id => $str )
   841 {
   898 {
   842   if ( $_GET['mode'] == $id )
   899   if ( $_GET['mode'] == $id )
   843   {
   900   {
   844     $flags = 'style="font-weight: bold; text-decoration: underline;"';
   901     $flags = 'style="font-weight: bold; text-decoration: underline;"';
   846   }
   903   }
   847   else
   904   else
   848   {
   905   {
   849     $flags = '';
   906     $flags = '';
   850   }
   907   }
   851   $p->assign_vars(Array(
   908   if ( $id == '_hiddenstages' )
   852       'HREF' => '#',
   909     $hidden = true;
   853       'FLAGS' => $flags . ' onclick="return false;"',
   910   if ( !$hidden )
   854       'TEXT' => $str
   911   {
   855     ));
   912     $p->assign_vars(Array(
   856   $sideinfo .= $p->run();
   913         'HREF' => '#',
       
   914         'FLAGS' => $flags . ' onclick="return false;"',
       
   915         'TEXT' => $str
       
   916       ));
       
   917     $sideinfo .= $p->run();
       
   918   }
   857 }
   919 }
   858 
   920 
   859 $template->init_vars();
   921 $template->init_vars();
   860 
   922 
   861 if(isset($_GET['mode']) && $_GET['mode'] == 'css')
   923 if(isset($_GET['mode']) && $_GET['mode'] == 'css')
   864   echo $template->get_css();
   926   echo $template->get_css();
   865   exit;
   927   exit;
   866 }
   928 }
   867 
   929 
   868 $template->header();
   930 $template->header();
   869 if(!isset($_GET['mode'])) $_GET['mode'] = 'license';
   931 if ( !isset($_GET['mode']) )
       
   932 {
       
   933   $_GET['mode'] = 'welcome';
       
   934 }
   870 switch($_GET['mode'])
   935 switch($_GET['mode'])
   871 { 
   936 { 
   872   default:
   937   default:
   873   case 'welcome':
   938   case 'welcome':
   874     ?>
   939     ?>
   892   case "license":
   957   case "license":
   893     ?>
   958     ?>
   894     <h3>Welcome to the Enano installer.</h3>
   959     <h3>Welcome to the Enano installer.</h3>
   895      <p>Thank you for choosing Enano as your CMS. You've selected the finest in design, the strongest in security, and the latest in Web 2.0 toys. Trust us, you'll like it.</p>
   960      <p>Thank you for choosing Enano as your CMS. You've selected the finest in design, the strongest in security, and the latest in Web 2.0 toys. Trust us, you'll like it.</p>
   896      <p>To get started, please read and accept the following license agreement. You've probably seen it before.</p>
   961      <p>To get started, please read and accept the following license agreement. You've probably seen it before.</p>
   897      <div style="height: 500px; clip: rect(0px,auto,500px,auto); overflow: auto; padding: 10px; border: 1px dashed #456798; margin: 1em;">
   962      <?php show_license(); ?>
   898        <h2>GNU General Public License</h2>
       
   899        <h3>Declaration of license usage</h3>
       
   900        <p>Enano is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.</p>
       
   901        <p>This program is distributed in the hope that it will be useful, but <u>without any warranty</u>; without even the implied warranty of <u>merchantability</u> or <u>fitness for a particular purpose</u>. See the GNU General Public License (below) for more details.</p>
       
   902        <p><b>By clicking the button below or otherwise continuing the installation, you indicate your acceptance of this license agreement.</b></p>
       
   903        <h3>Human-readable version</h3>
       
   904        <p>Enano is distributed under certain licensing terms that we believe make it of the greatest possible use to the public. The license we distribute it under, the GNU General Public License, provides certain terms and conditions that, rather than limit your use of Enano, allow you to get the most out of it. If you would like to read the full text, it can be found below. Here is a human-readable version that we think is a little easier to understand.</p>
       
   905        <ul>
       
   906        <li>You may to run Enano for any purpose.</li>
       
   907        <li>You may study how Enano works and adapt it to your needs.</li>
       
   908        <li>You may redistribute copies so you can help your neighbor.</li>
       
   909        <li>You may improve Enano and release your improvements to the public, so that the whole community benefits.</li>
       
   910        </ul>
       
   911        <p>You may exercise the freedoms specified here provided that you comply with the express conditions of this license. The principal conditions are:</p>
       
   912        <ul>
       
   913        <li>You must conspicuously and appropriately publish on each copy distributed an appropriate copyright notice and disclaimer of warranty and keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of Enano a copy of the GNU General Public License along with Enano. Any translation of the GNU General Public License must be accompanied by the GNU General Public License.</li>
       
   914        <li>If you modify your copy or copies of Enano or any portion of it, or develop a program based upon it, you may distribute the resulting work provided you do so under the GNU General Public License. Any translation of the GNU General Public License must be accompanied by the GNU General Public License.</li>
       
   915        <li>If you copy or distribute Enano, you must accompany it with the complete corresponding machine-readable source code or with a written offer, valid for at least three years, to furnish the complete corresponding machine-readable source code.</li>
       
   916        </ul>
       
   917        <p><b>Disclaimer</b>: The above text is not a license. It is simply a handy reference for understanding the Legal Code (the full license) &ndash; it is a human-readable expression of some of its key terms. Think of it as the user-friendly interface to the Legal Code beneath. The above text itself has no legal value, and its contents do not appear in the actual license.<br /><span style="color: #CCC">Text copied from the <a href="http://creativecommons.org/licenses/GPL/2.0/">Creative Commons GPL Deed page</a></span></p>
       
   918        <?php
       
   919        if ( defined('ENANO_BETA_VERSION') )
       
   920        {
       
   921          ?>
       
   922          <h3>Notice for prerelease versions</h3>
       
   923          <p>This version of Enano is designed only for testing and evaluation purposes. <b>It is not yet completely stable, and should not be used on production websites.</b> As with any Enano version, Dan Fuhry and the Enano team cannot be responsible for any damage, physical or otherwise, to any property as a result of the use of Enano. While security is a number one priority, sometimes things slip through.</p>
       
   924          <?php
       
   925        }
       
   926        ?>
       
   927        <h3>Lawyer-readable version</h3>
       
   928        <?php echo wikiFormat(file_get_contents(ENANO_ROOT . '/GPL')); ?>
       
   929      </div>
       
   930      <div class="pagenav">
   963      <div class="pagenav">
   931        <form action="install.php?mode=sysreqs" method="post">
   964        <form action="install.php?mode=sysreqs" method="post">
   932          <table border="0">
   965          <table border="0">
   933          <tr>
   966          <tr>
   934          <td><input type="submit" value="I agree to the license terms" /></td><td><p><span style="font-weight: bold;">Before clicking continue:</span><br />&bull; Ensure that you agree with the terms of the license<br />&bull; Have your database host, name, username, and password available</p></td>
   967          <td><input type="submit" value="I agree to the license terms" /></td><td><p><span style="font-weight: bold;">Before clicking continue:</span><br />&bull; Ensure that you agree with the terms of the license<br />&bull; Have your database host, name, username, and password available</p></td>
  1657              <li>Tell the <a href="http://enanocms.org/Contact_us">Enano team</a> what you think.</li>
  1690              <li>Tell the <a href="http://enanocms.org/Contact_us">Enano team</a> what you think.</li>
  1658              <li><b>Spread the word about Enano by adding a link to the Enano homepage on your sidebar!</b> You can enable this option in the General Configuration section of the administration panel.</li>
  1691              <li><b>Spread the word about Enano by adding a link to the Enano homepage on your sidebar!</b> You can enable this option in the General Configuration section of the administration panel.</li>
  1659            </ul>
  1692            </ul>
  1660            <p><a href="index.php">Go to your website...</a></p>';
  1693            <p><a href="index.php">Go to your website...</a></p>';
  1661     break;
  1694     break;
       
  1695   // this stage is never shown during the installation, but is provided for legal purposes
       
  1696   case "showlicense":
       
  1697     show_license(true);
       
  1698     break;
  1662 }
  1699 }
  1663 $template->footer();
  1700 $template->footer();
  1664  
  1701  
  1665 ?>
  1702 ?>