diff -r 90b7a52bea45 -r 62ee6685ad18 install.php
--- a/install.php Sat Oct 20 21:59:27 2007 -0400
+++ b/install.php Thu Nov 15 18:00:39 2007 -0500
@@ -1,1214 +1,1822 @@
-The Enano installer has found a Enano installation in this directory. You MUST delete config.php if you want to re-install Enano.
If you wish to upgrade an older Enano installation to this version, please use the upgrade script.
This option allows you to control whether anything between the standard <?php and ?> tags will be treated as
- PHP code by Enano. If this option is enabled, and members of the Administrators group use these tags, Enano will
- execute that code when the page is loaded. There are obvious potential security implications here, which should
- be carefully considered before enabling this option.
-
If you are the only administrator of this site, or if you have a high level of trust for those will be administering
- the site with you, you should enable this to allow extreme customization of pages.
-
Leave this option off if you are at all concerned about security – if your account is compromised and PHP embedding
- is enabled, an attacker can run arbitrary code on your server! Enabling this will also allow administrators to
- embed Javascript and arbitrary HTML and CSS.
-
If you don\'t have experience coding in PHP, you can safely disable this option. You may change this at any time
- using the ACL editor by selecting the Administrators group and This Entire Website under the scope selection.
- You are about to install a NIGHTLY BUILD of Enano. 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.
';
- }
- ?>
-
-
-
-
Welcome to the Enano installer.
-
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.
-
To get started, please read and accept the following license agreement. You've probably seen it before.
-
-
GNU General Public License
-
Declaration of license usage
-
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.
-
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the GNU General Public License (below) for more details.
-
By clicking the button below or otherwise continuing the installation, you indicate your acceptance of this license agreement.
-
Human-readable version
-
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.
-
-
You may to run Enano for any purpose.
-
You may study how Enano works and adapt it to your needs.
-
You may redistribute copies so you can help your neighbor.
-
You may improve Enano and release your improvements to the public, so that the whole community benefits.
-
-
You may exercise the freedoms specified here provided that you comply with the express conditions of this license. The principal conditions are:
-
-
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.
-
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.
-
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.
-
-
Disclaimer: The above text is not a license. It is simply a handy reference for understanding the Legal Code (the full license) – 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. Text copied from the Creative Commons GPL Deed page
-
-
Notice for prerelease versions
-
This version of Enano is designed only for testing and evaluation purposes. It is not yet completely stable, and should not be used on production websites. 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.
-
-
Lawyer-readable version
-
-
-
-
-
-
-
Checking your server
-
Enano has several requirements that must be met before it can be installed. If all is good then note any warnings and click Continue below.
-
- =4.3.0', 'It seems that the version of PHP that your server is running is too old to support Enano properly. If this is your server, please upgrade to the most recent version of PHP, remembering to use the --with-mysql configure option if you compile it yourself. If this is not your server, please contact your webhost and ask them if it would be possible to upgrade PHP. If this is not possible, you will need to switch to a different webhost in order to use Enano.');
- run_test('return function_exists(\'mysql_connect\');', 'MySQL extension for PHP', 'It seems that your PHP installation does not have the MySQL extension enabled. If this is your own server, you may need to just enable the "libmysql.so" extension in php.ini. If you do not have the MySQL extension installed, you will need to either use your distribution\'s package manager to install it, or you will have to compile PHP from source. If you compile PHP from source, please remember to use the "--with-mysql" configure option, and you will have to have the MySQL development files installed (they usually are). If this is not your server, please contact your hosting company and ask them to install the PHP MySQL extension.');
- run_test('return @ini_get(\'file_uploads\');', 'File upload support', 'It seems that your server does not support uploading files. Enano *requires* this functionality in order to work properly. Please ask your server administrator to set the "file_uploads" option in php.ini to "On".');
- run_test('return is_apache();', 'Apache HTTP Server', 'Apparently your server is running a web server other than Apache. Enano will work nontheless, but there are some known bugs with non-Apache servers, and the "fancy" URLs will not work properly. The "Standard URLs" option will be set on the website configuration page, only change it if you are absolutely certain that your server is running Apache.', true);
- //run_test('return function_exists(\'finfo_file\');', 'Fileinfo PECL extension', 'The MIME magic PHP extension is used to determine the type of a file by looking for a certain "magic" string of characters inside it. This functionality is used by Enano to more effectively prevent malicious file uploads. The MIME magic option will be disabled by default.', true);
- run_test('return is_writable(ENANO_ROOT.\'/config.php\');', 'Configuration file writable', 'It looks like the configuration file, config.php, is not writable. Enano needs to be able to write to this file in order to install.
If you are installing Enano on a SourceForge web site: SourceForge mounts the web partitions read-only now, so you will need to use the project shell service to symlink config.php to a file in the /tmp/persistent directory.');
- run_test('return file_exists(\'/usr/bin/convert\');', 'ImageMagick support', 'Enano uses ImageMagick to scale images into thumbnails. Because ImageMagick was not found on your server, Enano will use the width= and height= attributes on the <img> tag to scale images. This can cause somewhat of a performance increase, but bandwidth usage will be higher, especially if you use high-resolution images on your site.
If you are sure that you have ImageMagick, you can set the location of the "convert" program using the administration panel after installation is complete.', true);
- run_test('return is_writable(ENANO_ROOT.\'/cache/\');', 'Cache directory writable', 'Apparently the cache/ directory is not writable. Enano will still work, but you will not be able to cache thumbnails, meaning the server will need to re-render them each time they are requested. In some cases, this can cause a significant slowdown.', true);
- run_test('return is_writable(ENANO_ROOT.\'/files/\');', 'File uploads directory writable', 'It seems that the directory where uploaded files are stored (' . ENANO_ROOT . '/files) cannot be written by the server. Enano will still function, but file uploads will not function, and will be disabled by default.', true);
- echo '
';
- if(!$failed)
- {
- ?>
-
-
- ';
- run_test('return false;', 'Some scalebacks were made due to your server configuration.', 'Enano has detected that some of the features or configuration settings on your server are not optimal for the best behavior and/or performance for Enano. As a result, certain features or enhancements that are part of Enano have been disabled to prevent further errors. You have seen those "fatal error" notices that spew from PHP, haven\'t you?
Fatal error: call to undefined function wannahokaloogie() in file '.__FILE__.' on line '.__LINE__.'', true);
- echo '
';
- } else {
- echo '
';
- run_test('return true;', 'Your server meets all the requirements for running Enano. Click the button below to continue the installation.', 'You should never see this text. Congratulations for being an Enano hacker!');
- echo '
';
- }
- ?>
-
-
-
';
- run_test('return false;', 'Your server does not meet the requirements for Enano to run.', 'As a precaution, Enano will not install until the above requirements have been met. Contact your server administrator or hosting company and convince them to upgrade. Good luck.');
- echo '
';
- }
- }
- ?>
-
-
-
Now we need some information that will allow Enano to contact your database server. Enano uses MySQL as a data storage backend,
- and we need to have access to a MySQL server in order to continue.
-
If you do not have access to a MySQL server, and you are using your own server, you can download MySQL for free from
- MySQL.com. Please note that, like Enano, MySQL is licensed under the GNU GPL.
- If you need to modify MySQL and then distribute your modifications, you must either distribute them under the terms of the GPL
- or purchase a proprietary license.
- MySQL login information for this virtual appliance:
You have finished installing Enano on this server.
-
Now what?
-
Click the link below to see the main page for your website. Where to go from here:
-
-
The first thing you should do is log into your site using the Log in link on the sidebar.
-
Go into the Administration panel, expand General, and click General Configuration. There you will be able to configure some basic information about your site.
Periodically create a backup of your database and filesystem, in case something goes wrong. This should be done at least once a week – more for wiki-based sites.
-
Hire some moderators, to help you keep rowdy users tame.
Spread the word about Enano by adding a link to the Enano homepage on your sidebar! You can enable this option in the General Configuration section of the administration panel.
';
- break;
-}
-$template->footer();
-
-?>
+The Enano installer has found a Enano installation in this directory. You MUST delete config.php if you want to re-install Enano.
If you wish to upgrade an older Enano installation to this version, please use the upgrade script.
This option allows you to control whether anything between the standard <?php and ?> tags will be treated as
+ PHP code by Enano. If this option is enabled, and members of the Administrators group use these tags, Enano will
+ execute that code when the page is loaded. There are obvious potential security implications here, which should
+ be carefully considered before enabling this option.
+
If you are the only administrator of this site, or if you have a high level of trust for those will be administering
+ the site with you, you should enable this to allow extreme customization of pages.
+
Leave this option off if you are at all concerned about security – if your account is compromised and PHP embedding
+ is enabled, an attacker can run arbitrary code on your server! Enabling this will also allow administrators to
+ embed Javascript and arbitrary HTML and CSS.
+
If you don\'t have experience coding in PHP, you can safely disable this option. You may change this at any time
+ using the ACL editor by selecting the Administrators group and This Entire Website under the scope selection.
version 1.0.2 – stable
+ also affectionately known as "coblynau" :)
+ You are about to install a NIGHTLY BUILD of Enano. 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.
';
+ }
+ ?>
+
+
+
+
Welcome to the Enano installer.
+
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.
+
To get started, please read and accept the following license agreement. You've probably seen it before.
+
+
GNU General Public License
+
Declaration of license usage
+
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.
+
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the GNU General Public License (below) for more details.
+
By clicking the button below or otherwise continuing the installation, you indicate your acceptance of this license agreement.
+
Human-readable version
+
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.
+
+
You may to run Enano for any purpose.
+
You may study how Enano works and adapt it to your needs.
+
You may redistribute copies so you can help your neighbor.
+
You may improve Enano and release your improvements to the public, so that the whole community benefits.
+
+
You may exercise the freedoms specified here provided that you comply with the express conditions of this license. The principal conditions are:
+
+
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.
+
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.
+
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.
+
+
Disclaimer: The above text is not a license. It is simply a handy reference for understanding the Legal Code (the full license) – 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. Text copied from the Creative Commons GPL Deed page
+
+
Notice for prerelease versions
+
This version of Enano is designed only for testing and evaluation purposes. It is not yet completely stable, and should not be used on production websites. 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.
+
+
Lawyer-readable version
+
+
+
+
+
+
+
Checking your server
+
Enano has several requirements that must be met before it can be installed. If all is good then note any warnings and click Continue below.
+
+ =4.3.0', 'It seems that the version of PHP that your server is running is too old to support Enano properly. If this is your server, please upgrade to the most recent version of PHP, remembering to use the --with-mysql configure option if you compile it yourself. If this is not your server, please contact your webhost and ask them if it would be possible to upgrade PHP. If this is not possible, you will need to switch to a different webhost in order to use Enano.');
+ run_test('return function_exists(\'mysql_connect\');', 'MySQL extension for PHP', 'It seems that your PHP installation does not have the MySQL extension enabled. If this is your own server, you may need to just enable the "libmysql.so" extension in php.ini. If you do not have the MySQL extension installed, you will need to either use your distribution\'s package manager to install it, or you will have to compile PHP from source. If you compile PHP from source, please remember to use the "--with-mysql" configure option, and you will have to have the MySQL development files installed (they usually are). If this is not your server, please contact your hosting company and ask them to install the PHP MySQL extension.');
+ run_test('return @ini_get(\'file_uploads\');', 'File upload support', 'It seems that your server does not support uploading files. Enano *requires* this functionality in order to work properly. Please ask your server administrator to set the "file_uploads" option in php.ini to "On".');
+ run_test('return is_apache();', 'Apache HTTP Server', 'Apparently your server is running a web server other than Apache. Enano will work nontheless, but there are some known bugs with non-Apache servers, and the "fancy" URLs will not work properly. The "Standard URLs" option will be set on the website configuration page, only change it if you are absolutely certain that your server is running Apache.', true);
+ //run_test('return function_exists(\'finfo_file\');', 'Fileinfo PECL extension', 'The MIME magic PHP extension is used to determine the type of a file by looking for a certain "magic" string of characters inside it. This functionality is used by Enano to more effectively prevent malicious file uploads. The MIME magic option will be disabled by default.', true);
+ run_test('return is_writable(ENANO_ROOT.\'/config.new.php\');', 'Configuration file writable', 'It looks like the configuration file, config.new.php, is not writable. Enano needs to be able to write to this file in order to install.
If you are installing Enano on a SourceForge web site: SourceForge mounts the web partitions read-only now, so you will need to use the project shell service to symlink config.php to a file in the /tmp/persistent directory.');
+ run_test('return file_exists(\'/usr/bin/convert\');', 'ImageMagick support', 'Enano uses ImageMagick to scale images into thumbnails. Because ImageMagick was not found on your server, Enano will use the width= and height= attributes on the <img> tag to scale images. This can cause somewhat of a performance increase, but bandwidth usage will be higher, especially if you use high-resolution images on your site.
If you are sure that you have ImageMagick, you can set the location of the "convert" program using the administration panel after installation is complete.', true);
+ run_test('return is_writable(ENANO_ROOT.\'/cache/\');', 'Cache directory writable', 'Apparently the cache/ directory is not writable. Enano will still work, but you will not be able to cache thumbnails, meaning the server will need to re-render them each time they are requested. In some cases, this can cause a significant slowdown.', true);
+ run_test('return is_writable(ENANO_ROOT.\'/files/\');', 'File uploads directory writable', 'It seems that the directory where uploaded files are stored (' . ENANO_ROOT . '/files) cannot be written by the server. Enano will still function, but file uploads will not function, and will be disabled by default.', true);
+ echo '
';
+ if(!$failed)
+ {
+ ?>
+
+
+ ';
+ run_test('return false;', 'Some of the features of Enano have been turned off to accommodate your server.', 'Enano has detected that some of the features or configuration settings on your server are not optimal for the best behavior and/or performance for Enano. As a result, certain features or enhancements that are part of Enano have been disabled to prevent further errors. You have seen those "fatal error" notices that spew from PHP, haven\'t you?
Fatal error: call to undefined function wannahockaloogie() in file '.__FILE__.' on line '.__LINE__.'', true);
+ echo '
';
+ } else {
+ echo '
';
+ run_test('return true;', 'Your server meets all the requirements for running Enano. Click the button below to continue the installation.', 'You should never see this text. Congratulations for being an Enano hacker!');
+ echo '
';
+ }
+ ?>
+
+
+
';
+ run_test('return false;', 'Your server does not meet the requirements for Enano to run.', 'As a precaution, Enano will not install until the above requirements have been met. Contact your server administrator or hosting company and convince them to upgrade. Good luck.');
+ echo '
';
+ }
+ }
+ ?>
+
+
+
Now we need some information that will allow Enano to contact your database server. Enano uses MySQL as a data storage backend,
+ and we need to have access to a MySQL server in order to continue.
+
If you do not have access to a MySQL server, and you are using your own server, you can download MySQL for free from
+ MySQL.com. Please note that, like Enano, MySQL is licensed under the GNU GPL.
+ If you need to modify MySQL and then distribute your modifications, you must either distribute them under the terms of the GPL
+ or purchase a proprietary license.
+ MySQL login information for this virtual appliance:
ERROR: Cannot open config.php for writing - exiting!
';
+ $template->footer();
+ exit;
+ }
+ fwrite($handle, '');
+ fclose($handle);
+ }
+ // Sorry for the ugly hack, but this f***s up jEdit badly.
+ echo '
+
+ ';
+ ?>
+
+
+ restart the installation.';
+ $template->footer();
+ exit;
+ }
+ unset($_POST['_cont']);
+ ?>
+
+ restart the installation.';
+ $template->footer();
+ exit;
+ }
+ switch($_POST['urlscheme'])
+ {
+ case "ugly":
+ default:
+ $cp = scriptPath.'/index.php?title=';
+ break;
+ case "short":
+ $cp = scriptPath.'/index.php/';
+ break;
+ case "tiny":
+ $cp = scriptPath.'/';
+ break;
+ }
+ function err($t) { global $template; echo $t; $template->footer(); exit; }
+
+ // $stages = array('connect', 'decrypt', 'genkey', 'parse', 'sql', 'writeconfig', 'renameconfig', 'startapi', 'initlogs');
+
+ if ( !preg_match('/^[a-z0-9_]*$/', $_POST['table_prefix']) )
+ err('Hacking attempt was detected in table_prefix.');
+
+ start_install_table();
+ // The stages connect, decrypt, genkey, and parse are preprocessing and don't do any actual data modification.
+ // Thus, they need to be run on each retry, e.g. never skipped.
+ run_installer_stage('connect', 'Connect to MySQL', 'stg_mysql_connect', 'MySQL denied our attempt to connect to the database. This is most likely because your login information was incorrect. You will most likely need to restart the installation.', false);
+ if ( isset($_POST['drop_tables']) )
+ {
+ // Are we supposed to drop any existing tables? If so, do it now
+ run_installer_stage('drop', 'Drop existing Enano tables', 'stg_drop_tables', 'This step never returns failure');
+ }
+ run_installer_stage('decrypt', 'Decrypt administration password', 'stg_decrypt_admin_pass', 'The administration password you entered couldn\'t be decrypted. It is possible that your server did not properly store the encryption key in the configuration file. Please check the file permissions on config.new.php. You may have to return to the login stage of the installation, clear your browser cache, and then rerun this installation.', false);
+ run_installer_stage('genkey', 'Generate ' . AES_BITS . '-bit AES private key', 'stg_generate_aes_key', 'Enano encountered an internal error while generating the site encryption key. Please contact the Enano team for support.', false);
+ run_installer_stage('parse', 'Prepare to execute schema file', 'stg_parse_schema', 'Enano encountered an internal error while parsing the SQL file that contains the database structure and initial data. Please contact the Enano team for support.', false);
+ run_installer_stage('sql', 'Execute installer schema', 'stg_install', 'The installation failed because an SQL query wasn\'t quite correct. It is possible that you entered malformed data into a form field, or there may be a bug in Enano with your version of MySQL. Please contact the Enano team for support.', false);
+ run_installer_stage('writeconfig', 'Write configuration files', 'stg_write_config', 'Enano was unable to write the configuration file with your site\'s database credentials. This is almost always because your configuration file does not have the correct permissions. On Windows servers, you may see this message even if the check on the System Requirements page passed. Temporarily running IIS as the Administrator user may help.');
+ run_installer_stage('renameconfig', 'Rename configuration files', 'stg_rename_config', 'Enano couldn\'t rename the configuration files to their correct production names. On some UNIX systems, you need to CHMOD the directory with your Enano files to 777 in order for this stage to succeed.');
+
+ // Mainstream installation complete - Enano should be usable now
+ // The stage of starting the API is special because it has to be called out of function context.
+ // To alleviate this, we have two functions, one that returns success and one that returns failure
+ // If the Enano API load is successful, the success function is called to report the action to the user
+ // If unsuccessful, the failure report is sent
+
+ $template_bak = $template;
+
+ $_GET['title'] = 'Main_Page';
+ require('includes/common.php');
+
+ if ( is_object($db) && is_object($session) )
+ {
+ run_installer_stage('startapi', 'Start the Enano API', 'stg_start_api_success', '...', false);
+ }
+ else
+ {
+ run_installer_stage('startapi', 'Start the Enano API', 'stg_start_api_failure', 'The Enano API could not be started. This is an error that should never occur; please contact the Enano team for support.', false);
+ }
+
+ // We need to be logged in (with admin rights) before logs can be flushed
+ $admin_password = stg_decrypt_admin_pass(true);
+ $session->login_without_crypto($_POST['admin_user'], $admin_password, false);
+
+ // Now that login cookies are set, initialize the session manager and ACLs
+ $session->start();
+ $paths->init();
+
+ run_installer_stage('initlogs', 'Initialize logs', 'stg_init_logs', 'The session manager denied the request to flush logs for the main page.
+ While under most circumstances you can still finish the installation, you should be aware that some servers cannot
+ properly set cookies due to limitations with PHP. These limitations are exposed primarily when this issue is encountered during installation. If you choose
+ to finish the installation, please be aware that you may be unable to log into your site.');
+ close_install_table();
+
+ unset($template);
+ $template =& $template_bak;
+
+ echo '
You have finished installing Enano on this server.
+
Now what?
+
Click the link below to see the main page for your website. Where to go from here:
+
+
The first thing you should do is log into your site using the Log in link on the sidebar.
+
Go into the Administration panel, expand General, and click General Configuration. There you will be able to configure some basic information about your site.
Periodically create a backup of your database and filesystem, in case something goes wrong. This should be done at least once a week – more for wiki-based sites.
+
Hire some moderators, to help you keep rowdy users tame.
Spread the word about Enano by adding a link to the Enano homepage on your sidebar! You can enable this option in the General Configuration section of the administration panel.