--- a/install.php Tue Nov 06 16:40:19 2007 -0500
+++ b/install.php Wed Nov 07 16:33:26 2007 -0500
@@ -25,6 +25,7 @@
define('IN_ENANO_INSTALL', 'true');
define('ENANO_VERSION', '1.1.1');
+define('ENANO_CODE_NAME', 'Germination');
// In beta versions, define ENANO_BETA_VERSION here
// This is required to make installation work right
@@ -65,14 +66,18 @@
require('includes/constants.php');
require('includes/rijndael.php');
require('includes/functions.php');
+require('includes/dbal.php');
+require('includes/lang.php');
+require('includes/json.php');
strip_magic_quotes_gpc();
-$neutral_color = 'C';
//
// INSTALLER LIBRARY
//
+$neutral_color = 'C';
+
function run_installer_stage($stage_id, $stage_name, $function, $failure_explanation, $allow_skip = true)
{
static $resumed = false;
@@ -657,22 +662,37 @@
if($val)
{
if($cv) $color='CCFFCC'; else $color='AAFFAA';
- echo "<tr><td style='background-color: #$color; width: 500px;'>$desc</td><td style='padding-left: 10px;'><img alt='Test passed' src='images/good.gif' /></td></tr>";
+ echo "<tr><td style='background-color: #$color; width: 500px; padding: 5px;'>$desc</td><td style='padding-left: 10px;'><img alt='Test passed' src='images/good.gif' /></td></tr>";
} elseif(!$val && $warn) {
if($cv) $color='FFFFCC'; else $color='FFFFAA';
- echo "<tr><td style='background-color: #$color; width: 500px;'>$desc<br /><b>$extended_desc</b></td><td style='padding-left: 10px;'><img alt='Test passed with warning' src='images/unknown.gif' /></td></tr>";
+ echo "<tr><td style='background-color: #$color; width: 500px; padding: 5px;'>$desc<br /><b>$extended_desc</b></td><td style='padding-left: 10px;'><img alt='Test passed with warning' src='images/unknown.gif' /></td></tr>";
$warned = true;
} else {
if($cv) $color='FFCCCC'; else $color='FFAAAA';
- 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>";
+ echo "<tr><td style='background-color: #$color; width: 500px; padding: 5px;'>$desc<br /><b>$extended_desc</b></td><td style='padding-left: 10px;'><img alt='Test failed' src='images/bad.gif' /></td></tr>";
$failed = true;
}
}
-function is_apache() { $r = strstr($_SERVER['SERVER_SOFTWARE'], 'Apache') ? true : false; return $r; }
+function is_apache()
+{
+ return strstr($_SERVER['SERVER_SOFTWARE'], 'Apache') ? true : false;
+}
require_once('includes/template.php');
-if(!isset($_GET['mode'])) $_GET['mode'] = 'welcome';
+//
+// Startup localization
+//
+
+// We need $db just for the _die function
+$db = new mysql();
+
+$lang = new Language('eng');
+$lang->load_file('./language/english/install.json');
+
+if ( !isset($_GET['mode']) )
+ $_GET['mode'] = 'welcome';
+
switch($_GET['mode'])
{
case 'mysql_test':
@@ -802,6 +822,20 @@
EOF;
exit;
break;
+ case 'langjs':
+ header('Content-type: text/javascript');
+ $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE);
+ $lang_js = $json->encode($lang->strings);
+ // use EEOF here because jEdit misinterprets "typ'eof'"
+ echo <<<EEOF
+if ( typeof(enano_lang) != 'object' )
+ var enano_lang = new Object();
+
+enano_lang[1] = $lang_js;
+
+EEOF;
+ exit;
+ break;
default:
break;
}
@@ -810,15 +844,15 @@
$template->load_theme('stpatty', 'shamrock', false);
$modestrings = Array(
- 'welcome' => 'Welcome',
- 'license' => 'License Agreement',
- 'sysreqs' => 'Server requirements',
- 'database'=> 'Database information',
- 'website' => 'Website configuration',
- 'login' => 'Administration login',
- 'confirm' => 'Confirm installation',
- 'install' => 'Database installation',
- 'finish' => 'Installation complete'
+ 'welcome' => $lang->get('welcome_modetitle'),
+ 'license' => $lang->get('license_modetitle'),
+ 'sysreqs' => $lang->get('sysreqs_modetitle'),
+ 'database'=> $lang->get('database_modetitle'),
+ 'website' => $lang->get('website_modetitle'),
+ 'login' => $lang->get('login_modetitle'),
+ 'confirm' => $lang->get('confirm_modetitle'),
+ 'install' => $lang->get('install_modetitle'),
+ 'finish' => $lang->get('finish_modetitle')
);
$sideinfo = '';
@@ -852,6 +886,26 @@
exit;
}
+if ( defined('ENANO_IS_STABLE') )
+ $branch = 'stable';
+else if ( defined('ENANO_IS_UNSTABLE') )
+ $branch = 'unstable';
+else
+{
+ $version = explode('.', ENANO_VERSION);
+ if ( !isset($version[1]) )
+ // unknown branch, really
+ $branch = 'unstable';
+ else
+ {
+ $version[1] = intval($version[1]);
+ if ( $version[1] % 2 == 1 )
+ $branch = 'unstable';
+ else
+ $branch = 'stable';
+ }
+}
+
$template->header();
if(!isset($_GET['mode'])) $_GET['mode'] = 'license';
switch($_GET['mode'])
@@ -861,63 +915,71 @@
?>
<div style="text-align: center; margin-top: 10px;">
<img alt="[ Enano CMS Project logo ]" src="images/enano-artwork/installer-greeting-green.png" style="display: block; margin: 0 auto; padding-left: 100px;" />
- <h2>Welcome to Enano</h2>
- <h3>version 1.1.1 – unstable</h3>
+ <h2><?php echo $lang->get('welcome_heading'); ?></h2>
+ <h3>
+ <?php
+ $branch_l = $lang->get("welcome_branch_$branch");
+
+ $v_string = sprintf('%s %s – %s', $lang->get('welcome_version'), ENANO_VERSION, $branch_l);
+ echo $v_string;
+ ?>
+ </h3>
<?php
- if ( file_exists('./_nightly.php') )
- {
- 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>';
- }
+ if ( defined('ENANO_CODE_NAME') )
+ {
+ echo '<p>';
+ echo $lang->get('welcome_aka', array(
+ 'codename' => strtolower(ENANO_CODE_NAME)
+ ));
+ echo '</p>';
+ }
?>
<form action="install.php?mode=license" method="post">
- <input type="submit" value="Start installation" />
+ <input type="submit" value="<?php echo $lang->get('welcome_btn_start'); ?>" />
</form>
</div>
<?php
break;
case "license":
?>
- <h3>Welcome to the Enano installer.</h3>
- <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>
- <p>To get started, please read and accept the following license agreement. You've probably seen it before.</p>
+ <h3><?php echo $lang->get('license_heading'); ?></h3>
+ <p><?php echo $lang->get('license_blurb_thankyou'); ?></p>
+ <p><?php echo $lang->get('license_blurb_pleaseread'); ?></p>
<div style="height: 500px; clip: rect(0px,auto,500px,auto); overflow: auto; padding: 10px; border: 1px dashed #456798; margin: 1em;">
- <h2>GNU General Public License</h2>
- <h3>Declaration of license usage</h3>
- <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>
- <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>
- <p><b>By clicking the button below or otherwise continuing the installation, you indicate your acceptance of this license agreement.</b></p>
- <h3>Human-readable version</h3>
- <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>
- <ul>
- <li>You may to run Enano for any purpose.</li>
- <li>You may study how Enano works and adapt it to your needs.</li>
- <li>You may redistribute copies so you can help your neighbor.</li>
- <li>You may improve Enano and release your improvements to the public, so that the whole community benefits.</li>
- </ul>
- <p>You may exercise the freedoms specified here provided that you comply with the express conditions of this license. The principal conditions are:</p>
- <ul>
- <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>
- <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>
- <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>
- </ul>
- <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) – 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>
<?php
- if ( defined('ENANO_BETA_VERSION') )
+ if ( !file_exists('./GPL') || !file_exists('./language/english/install/license-deed.html') )
+ {
+ echo 'Cannot find the license files.';
+ }
+ echo file_get_contents('./language/english/install/license-deed.html');
+ if ( defined('ENANO_BETA_VERSION') || $branch == 'unstable' )
{
?>
- <h3>Notice for prerelease versions</h3>
- <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>
+ <h3><?php echo $lang->get('license_info_unstable_title'); ?></h3>
+ <p><?php echo $lang->get('license_info_unstable_body'); ?></p>
<?php
}
?>
- <h3>Lawyer-readable version</h3>
+ <h3><?php echo $lang->get('license_section_gpl_heading'); ?></h3>
+ <?php if ( $lang->lang_code != 'eng' ): ?>
+ <p><i><?php echo $lang->get('license_gpl_blurb_inenglish'); ?></i></p>
+ <?php endif; ?>
<?php echo wikiFormat(file_get_contents(ENANO_ROOT . '/GPL')); ?>
</div>
<div class="pagenav">
<form action="install.php?mode=sysreqs" method="post">
<table border="0">
<tr>
- <td><input type="submit" value="I agree to the license terms" /></td><td><p><span style="font-weight: bold;">Before clicking continue:</span><br />• Ensure that you agree with the terms of the license<br />• Have your database host, name, username, and password available</p></td>
+ <td>
+ <input type="submit" value="<?php echo $lang->get('license_btn_i_agree'); ?>" />
+ </td>
+ <td>
+ <p>
+ <span style="font-weight: bold;"><?php echo $lang->get('meta_lbl_before_continue'); ?></span><br />
+ • <?php echo $lang->get('license_objective_ensure_agree'); ?><br />
+ • <?php echo $lang->get('license_objective_have_db_info'); ?>
+ </p>
+ </td>
</tr>
</table>
</form>
@@ -927,19 +989,18 @@
case "sysreqs":
error_reporting(E_ALL);
?>
- <h3>Checking your server</h3>
- <p>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.</p>
+ <h3><?php echo $lang->get('sysreqs_heading'); ?></h3>
+ <p><?php echo $lang->get('sysreqs_blurb'); ?></p>
<table border="0" cellspacing="0" cellpadding="0">
<?php
- run_test('return version_compare(\'4.3.0\', PHP_VERSION, \'<\');', 'PHP Version >=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.<br /><br /><b>If you are installing Enano on a SourceForge web site:</b><br />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.<br /><br />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);
+ run_test('return version_compare(\'4.3.0\', PHP_VERSION, \'<\');', $lang->get('sysreqs_req_php'), $lang->get('sysreqs_req_desc_php') );
+ run_test('return function_exists(\'mysql_connect\');', $lang->get('sysreqs_req_mysql'), $lang->get('sysreqs_req_desc_mysql') );
+ run_test('return @ini_get(\'file_uploads\');', $lang->get('sysreqs_req_uploads'), $lang->get('sysreqs_req_desc_uploads') );
+ run_test('return is_apache();', $lang->get('sysreqs_req_apache'), $lang->get('sysreqs_req_desc_apache'), true);
+ run_test('return is_writable(ENANO_ROOT.\'/config.new.php\');', $lang->get('sysreqs_req_config'), $lang->get('sysreqs_req_desc_config') );
+ run_test('return file_exists(\'/usr/bin/convert\');', $lang->get('sysreqs_req_magick'), $lang->get('sysreqs_req_desc_magick'), true);
+ run_test('return is_writable(ENANO_ROOT.\'/cache/\');', $lang->get('sysreqs_req_cachewriteable'), $lang->get('sysreqs_req_desc_cachewriteable'), true);
+ run_test('return is_writable(ENANO_ROOT.\'/files/\');', $lang->get('sysreqs_req_fileswriteable'), $lang->get('sysreqs_req_desc_fileswriteable'), true);
echo '</table>';
if(!$failed)
{
@@ -949,27 +1010,39 @@
<?php
if($warned) {
echo '<table border="0" cellspacing="0" cellpadding="0">';
- 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?<br /><br />Fatal error:</b> call to undefined function wannahokaloogie() in file <b>'.__FILE__.'</b> on line <b>'.__LINE__.'', true);
+ run_test('return false;', $lang->get('sysreqs_summary_warn_title'), $lang->get('sysreqs_summary_warn_body'), true);
echo '</table>';
} else {
echo '<table border="0" cellspacing="0" cellpadding="0">';
- run_test('return true;', '<b>Your server meets all the requirements for running Enano.</b><br />Click the button below to continue the installation.', 'You should never see this text. Congratulations for being an Enano hacker!');
+ run_test('return true;', '<b>' . $lang->get('sysreqs_summary_success_title') . '</b><br />' . $lang->get('sysreqs_summary_success_body'), 'You should never see this text. Congratulations for being an Enano hacker!');
echo '</table>';
}
?>
- <form action="install.php?mode=database" method="post">
- <table border="0">
- <tr>
- <td><input type="submit" value="Continue" /></td><td><p><span style="font-weight: bold;">Before clicking continue:</span><br />• Ensure that you are satisfied with any scalebacks that may have been made to accomodate your server configuration<br />• Have your database host, name, username, and password available</p></td>
- </tr>
- </table>
- </form>
- </div>
- <?php
- } else {
- if($failed) {
+ <form action="install.php?mode=database" method="post">
+ <table border="0">
+ <tr>
+ <td>
+ <input type="submit" value="<?php echo $lang->get('meta_btn_continue'); ?>" />
+ </td>
+ <td>
+ <p>
+ <span style="font-weight: bold;"><?php echo $lang->get('meta_lbl_before_continue'); ?></span><br />
+ • <?php echo $lang->get('sysreqs_objective_scalebacks'); ?><br />
+ • <?php echo $lang->get('license_objective_have_db_info'); ?>
+ </p>
+ </td>
+ </tr>
+ </table>
+ </form>
+ </div>
+ <?php
+ }
+ else
+ {
+ if ( $failed )
+ {
echo '<div class="pagenav"><table border="0" cellspacing="0" cellpadding="0">';
- 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.');
+ run_test('return false;', $lang->get('sysreqs_summary_fail_title'), $lang->get('sysreqs_summary_fail_body'));
echo '</table></div>';
}
}
@@ -1018,7 +1091,7 @@
v = verify();
if(!v)
{
- alert('One or more of the form fields is incorrect. Please correct any information in the form that has an "X" next to it.');
+ alert($lang.get('meta_msg_err_verification'));
return false;
}
var frm = document.forms.dbinfo;
@@ -1041,10 +1114,10 @@
document.getElementById('s_db_name').src='images/good.gif';
document.getElementById('s_db_auth').src='images/good.gif';
document.getElementById('s_db_root').src='images/good.gif';
- if(t.match(/_creating_db/)) document.getElementById('e_db_name').innerHTML = '<b>Warning:<\/b> The database you specified does not exist. It will be created during installation.';
- if(t.match(/_creating_user/)) document.getElementById('e_db_auth').innerHTML = '<b>Warning:<\/b> The specified regular user does not exist or the password is incorrect. The user will be created during installation. If the user already exists, the password will be reset.';
+ if(t.match(/_creating_db/)) document.getElementById('e_db_name').innerHTML = $lang.get('database_msg_warn_creating_db');
+ if(t.match(/_creating_user/)) document.getElementById('e_db_auth').innerHTML = $lang.get('database_msg_warn_creating_user');
document.getElementById('s_mysql_version').src='images/good.gif';
- document.getElementById('e_mysql_version').innerHTML = 'Your version of MySQL meets Enano requirements.';
+ document.getElementById('e_mysql_version').innerHTML = $lang.get('database_msg_info_mysql_good');
}
else
{
@@ -1055,50 +1128,50 @@
document.getElementById('s_db_name').src='images/unknown.gif';
document.getElementById('s_db_auth').src='images/unknown.gif';
document.getElementById('s_db_root').src='images/unknown.gif';
- document.getElementById('e_db_host').innerHTML = '<b>Error:<\/b> The database server "'+document.forms.dbinfo.db_host.value+'" couldn\'t be contacted.<br \/>'+t;
- document.getElementById('e_mysql_version').innerHTML = 'The MySQL version that your server is running could not be determined.';
+ document.getElementById('e_db_host').innerHTML = $lang.get('database_msg_err_mysql_connect', { db_host: document.forms.dbinfo.db_host.value, mysql_error: t });
+ document.getElementById('e_mysql_version').innerHTML = $lang.get('database_msg_warn_mysql_version');
break;
case 'auth':
document.getElementById('s_db_host').src='images/good.gif';
document.getElementById('s_db_name').src='images/unknown.gif';
document.getElementById('s_db_auth').src='images/bad.gif';
document.getElementById('s_db_root').src='images/unknown.gif';
- document.getElementById('e_db_auth').innerHTML = '<b>Error:<\/b> Access to MySQL under the specified credentials was denied.<br \/>'+t;
- document.getElementById('e_mysql_version').innerHTML = 'The MySQL version that your server is running could not be determined.';
+ document.getElementById('e_db_auth').innerHTML = $lang.get('database_msg_err_mysql_auth', { mysql_error: t });
+ document.getElementById('e_mysql_version').innerHTML = $lang.get('database_msg_warn_mysql_version');
break;
case 'perm':
document.getElementById('s_db_host').src='images/good.gif';
document.getElementById('s_db_name').src='images/bad.gif';
document.getElementById('s_db_auth').src='images/good.gif';
document.getElementById('s_db_root').src='images/unknown.gif';
- document.getElementById('e_db_name').innerHTML = '<b>Error:<\/b> Access to the specified database using those login credentials was denied.<br \/>'+t;
- document.getElementById('e_mysql_version').innerHTML = 'The MySQL version that your server is running could not be determined.';
+ document.getElementById('e_db_name').innerHTML = $lang.get('database_msg_err_mysql_dbperm', { mysql_error: t });
+ document.getElementById('e_mysql_version').innerHTML = $lang.get('database_msg_warn_mysql_version');
break;
case 'name':
document.getElementById('s_db_host').src='images/good.gif';
document.getElementById('s_db_name').src='images/bad.gif';
document.getElementById('s_db_auth').src='images/good.gif';
document.getElementById('s_db_root').src='images/unknown.gif';
- document.getElementById('e_db_name').innerHTML = '<b>Error:<\/b> The specified database does not exist<br \/>'+t;
- document.getElementById('e_mysql_version').innerHTML = 'The MySQL version that your server is running could not be determined.';
+ document.getElementById('e_db_name').innerHTML = $lang.get('database_msg_err_mysql_dbexist', { mysql_error: t });
+ document.getElementById('e_mysql_version').innerHTML = $lang.get('database_msg_warn_mysql_version');
break;
case 'root':
document.getElementById('s_db_host').src='images/good.gif';
document.getElementById('s_db_name').src='images/unknown.gif';
document.getElementById('s_db_auth').src='images/unknown.gif';
document.getElementById('s_db_root').src='images/bad.gif';
- document.getElementById('e_db_root').innerHTML = '<b>Error:<\/b> Access to MySQL under the specified credentials was denied.<br \/>'+t;
- document.getElementById('e_mysql_version').innerHTML = 'The MySQL version that your server is running could not be determined.';
+ document.getElementById('e_db_root').innerHTML = $lang.get('database_msg_err_mysql_auth', { mysql_error: t });
+ document.getElementById('e_mysql_version').innerHTML = $lang.get('database_msg_warn_mysql_version');
break;
case 'vers':
document.getElementById('s_db_host').src='images/good.gif';
document.getElementById('s_db_name').src='images/good.gif';
document.getElementById('s_db_auth').src='images/good.gif';
document.getElementById('s_db_root').src='images/good.gif';
- if(t.match(/_creating_db/)) document.getElementById('e_db_name').innerHTML = '<b>Warning:<\/b> The database you specified does not exist. It will be created during installation.';
- if(t.match(/_creating_user/)) document.getElementById('e_db_auth').innerHTML = '<b>Warning:<\/b> The specified regular user does not exist or the password is incorrect. The user will be created during installation. If the user already exists, the password will be reset.';
+ if(t.match(/_creating_db/)) document.getElementById('e_db_name').innerHTML = $lang.get('database_msg_warn_creating_db');
+ if(t.match(/_creating_user/)) document.getElementById('e_db_auth').innerHTML = $lang.get('database_msg_warn_creating_user');
- document.getElementById('e_mysql_version').innerHTML = '<b>Error:<\/b> Your version of MySQL ('+t+') is older than 4.1.17. Enano will still work, but there is a known bug with the comment system and MySQL 4.1.11 that involves some comments not being displayed, due to an issue with the PHP function mysql_fetch_row().';
+ document.getElementById('e_mysql_version').innerHTML = $lang.get('database_msg_err_mysql_version', { mysql_version: t });
document.getElementById('s_mysql_version').src='images/bad.gif';
default:
alert(t);
@@ -1171,45 +1244,150 @@
}
window.onload = verify;
</script>
- <p>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.</p>
- <p>If you do not have access to a MySQL server, and you are using your own server, you can download MySQL for free from
- <a href="http://www.mysql.com/">MySQL.com</a>. <b>Please note that, like Enano, MySQL is licensed under the GNU GPL.</b>
- 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.</p>
+ <p><?php echo $lang->get('database_blurb_needdb'); ?></p>
+ <p><?php echo $lang->get('database_blurb_howtomysql'); ?></p>
<?php
if ( file_exists('/etc/enano-is-virt-appliance') )
{
- echo '<p><b>MySQL login information for this virtual appliance:</b><br /><br />Database hostname: localhost<br />Database login: username "enano", password: "clurichaun" (without quotes)<br />Database name: enano_www1</p>';
+ echo '<p>
+ ' . $lang->get('database_vm_login_info', array( 'host' => 'localhost', 'user' => 'enano', 'pass' => 'clurichaun', 'name' => 'enano_www1' )) . '
+ </p>';
}
?>
<form name="dbinfo" action="install.php?mode=website" method="post">
<table border="0">
- <tr><td colspan="3" style="text-align: center"><h3>Database information</h3></td></tr>
- <tr><td><b>Database hostname</b><br />This is the hostname (or sometimes the IP address) of your MySQL server. In many cases, this is "localhost".<br /><span style="color: #993300" id="e_db_host"></span></td><td><input onkeyup="verify();" name="db_host" size="30" type="text" /></td><td><img id="s_db_host" alt="Good/bad icon" src="images/bad.gif" /></td></tr>
- <tr><td><b>Database name</b><br />The name of the actual database. If you don't already have a database, you can create one here, if you have the username and password of a MySQL user with administrative rights.<br /><span style="color: #993300" id="e_db_name"></span></td><td><input onkeyup="verify();" name="db_name" size="30" type="text" /></td><td><img id="s_db_name" alt="Good/bad icon" src="images/bad.gif" /></td></tr>
- <tr><td rowspan="2"><b>Database login</b><br />These fields should be the username and password of a user with "select", "insert", "update", "delete", "create table", and "replace" privileges for your database.<br /><span style="color: #993300" id="e_db_auth"></span></td><td><input onkeyup="verify();" name="db_user" size="30" type="text" /></td><td rowspan="2"><img id="s_db_auth" alt="Good/bad icon" src="images/bad.gif" /></td></tr>
- <tr><td><input name="db_pass" size="30" type="password" /></td></tr>
- <tr><td colspan="3" style="text-align: center"><h3>Optional information</h3></td></tr>
- <tr><td><b>Table prefix</b><br />The value that you enter here will be added to the beginning of the name of each Enano table. You may use lowercase letters (a-z), numbers (0-9), and underscores (_).</td><td><input onkeyup="verify();" name="table_prefix" size="30" type="text" /></td><td><img id="s_table_prefix" alt="Good/bad icon" src="images/good.gif" /></td></tr>
- <tr><td rowspan="2"><b>Database administrative login</b><br />If the MySQL database or username that you entered above does not exist yet, you can create them here, assuming that you have the login information for an administrative user (such as root). Leave these fields blank unless you need to use them.<br /><span style="color: #993300" id="e_db_root"></span></td><td><input onkeyup="verify();" name="db_root_user" size="30" type="text" /></td><td rowspan="2"><img id="s_db_root" alt="Good/bad icon" src="images/good.gif" /></td></tr>
- <tr><td><input onkeyup="verify();" name="db_root_pass" size="30" type="password" /></td></tr>
- <tr><td><b>MySQL version</b></td><td id="e_mysql_version">MySQL version information will be checked when you click "Test Connection".</td><td><img id="s_mysql_version" alt="Good/bad icon" src="images/unknown.gif" /></td></tr>
- <tr><td><b>Delete existing tables?</b><br />If this option is checked, all the tables that will be used by Enano will be dropped (deleted) before the schema is executed. Do NOT use this option unless specifically instructed to.</td><td><input type="checkbox" name="drop_tables" id="dtcheck" /> <label for="dtcheck">Drop existing tables</label></td></tr>
- <tr><td colspan="3" style="text-align: center"><input type="button" value="Test connection" onclick="ajaxTestConnection();" /></td></tr>
+ <tr>
+ <td colspan="3" style="text-align: center">
+ <h3><?php echo $lang->get('database_table_title'); ?></h3>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b><?php echo $lang->get('database_field_hostname_title'); ?></b>
+ <br /><?php echo $lang->get('database_field_hostname_body'); ?>
+ <br /><span style="color: #993300" id="e_db_host"></span>
+ </td>
+ <td>
+ <input onkeyup="verify();" name="db_host" size="30" type="text" />
+ </td>
+ <td>
+ <img id="s_db_host" alt="Good/bad icon" src="images/bad.gif" />
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b><?php echo $lang->get('database_field_dbname_title'); ?></b><br />
+ <?php echo $lang->get('database_field_dbname_body'); ?><br />
+ <span style="color: #993300" id="e_db_name"></span>
+ </td>
+ <td>
+ <input onkeyup="verify();" name="db_name" size="30" type="text" />
+ </td>
+ <td>
+ <img id="s_db_name" alt="Good/bad icon" src="images/bad.gif" />
+ </td>
+ </tr>
+ <tr>
+ <td rowspan="2">
+ <b><?php echo $lang->get('database_field_dbauth_title'); ?></b><br />
+ <?php echo $lang->get('database_field_dbauth_body'); ?><br />
+ <span style="color: #993300" id="e_db_auth"></span>
+ </td>
+ <td>
+ <input onkeyup="verify();" name="db_user" size="30" type="text" />
+ </td>
+ <td rowspan="2">
+ <img id="s_db_auth" alt="Good/bad icon" src="images/bad.gif" />
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <input name="db_pass" size="30" type="password" />
+ </td>
+ </tr>
+ <tr>
+ <td colspan="3" style="text-align: center">
+ <h3><?php echo $lang->get('database_heading_optionalinfo'); ?></h3>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b><?php echo $lang->get('database_field_tableprefix_title'); ?></b><br />
+ <?php echo $lang->get('database_field_tableprefix_body'); ?>
+ </td>
+ <td>
+ <input onkeyup="verify();" name="table_prefix" size="30" type="text" />
+ </td>
+ <td>
+ <img id="s_table_prefix" alt="Good/bad icon" src="images/good.gif" />
+ </td>
+ </tr>
+ <tr>
+ <td rowspan="2">
+ <b><?php echo $lang->get('database_field_rootauth_title'); ?></b><br />
+ <?php echo $lang->get('database_field_rootauth_body'); ?><br />
+ <span style="color: #993300" id="e_db_root"></span>
+ </td>
+ <td>
+ <input onkeyup="verify();" name="db_root_user" size="30" type="text" />
+ </td>
+ <td rowspan="2">
+ <img id="s_db_root" alt="Good/bad icon" src="images/good.gif" />
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <input onkeyup="verify();" name="db_root_pass" size="30" type="password" />
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b><?php echo $lang->get('database_field_mysqlversion_title'); ?></b>
+ </td>
+ <td id="e_mysql_version">
+ <?php echo $lang->get('database_field_mysqlversion_blurb_willbechecked'); ?>
+ </td>
+ <td>
+ <img id="s_mysql_version" alt="Good/bad icon" src="images/unknown.gif" />
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b><?php echo $lang->get('database_field_droptables_title'); ?></b><br />
+ <?php echo $lang->get('database_field_droptables_body'); ?>
+ </td>
+ <td>
+ <input type="checkbox" name="drop_tables" id="dtcheck" /> <label for="dtcheck"><?php echo $lang->get('database_field_droptables_lbl'); ?></label>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="3" style="text-align: center">
+ <input type="button" value="<?php echo $lang->get('database_btn_testconnection'); ?>" onclick="ajaxTestConnection();" />
+ </td>
+ </tr>
</table>
<div class="pagenav">
- <table border="0">
- <tr>
- <td><input type="submit" value="Continue" onclick="return verify();" name="_cont" /></td><td><p><span style="font-weight: bold;">Before clicking continue:</span><br />• Check your MySQL connection using the "Test Connection" button.<br />• Be aware that your database information will be transmitted unencrypted several times.</p></td>
- </tr>
- </table>
- </div>
+ <table border="0">
+ <tr>
+ <td>
+ <input type="submit" value="<?php echo $lang->get('meta_btn_continue'); ?>" onclick="return verify();" name="_cont" />
+ </td>
+ <td>
+ <p>
+ <span style="font-weight: bold;"><?php echo $lang->get('meta_lbl_before_continue'); ?></span><br />
+ • <?php echo $lang->get('database_objective_test'); ?><br />
+ • <?php echo $lang->get('database_objective_uncrypt'); ?>
+ </p>
+ </td>
+ </tr>
+ </table>
+ </div>
</form>
<?php
break;
case "website":
- if(!isset($_POST['_cont'])) {
+ if ( !isset($_POST['_cont']) )
+ {
echo 'No POST data signature found. Please <a href="install.php?mode=license">restart the installation</a>.';
$template->footer();
exit;
@@ -1272,7 +1450,7 @@
<div class="pagenav">
<table border="0">
<tr>
- <td><input type="submit" value="Continue" onclick="return verify();" name="_cont" /></td><td><p><span style="font-weight: bold;">Before clicking continue:</span><br />• Verify that your site information is correct. Again, all of the above settings can be changed from the administration panel.</p></td>
+ <td><input type="submit" value="Continue" onclick="return verify();" name="_cont" /></td><td><p><span style="font-weight: bold;"><?php echo $lang->get('meta_lbl_before_continue'); ?></span><br />• Verify that your site information is correct. Again, all of the above settings can be changed from the administration panel.</p></td>
</tr>
</table>
</div>
@@ -1385,7 +1563,7 @@
<div class="pagenav">
<table border="0">
<tr>
- <td><input type="submit" value="Continue" onclick="return cryptdata();" name="_cont" /></td><td><p><span style="font-weight: bold;">Before clicking continue:</span><br />• Remember the username and password you enter here! You will not be able to administer your site without the information you enter on this page.</p></td>
+ <td><input type="submit" value="Continue" onclick="return cryptdata();" name="_cont" /></td><td><p><span style="font-weight: bold;"><?php echo $lang->get('meta_lbl_before_continue'); ?></span><br />• Remember the username and password you enter here! You will not be able to administer your site without the information you enter on this page.</p></td>
</tr>
</table>
</div>
@@ -1498,7 +1676,7 @@
<div class="pagenav">
<table border="0">
<tr>
- <td><input type="submit" value="Install Enano!" name="_cont" /></td><td><p><span style="font-weight: bold;">Before clicking continue:</span><br />• Pray.</p></td>
+ <td><input type="submit" value="Install Enano!" name="_cont" /></td><td><p><span style="font-weight: bold;"><?php echo $lang->get('meta_lbl_before_continue'); ?></span><br />• Pray.</p></td>
</tr>
</table>
</div>