# HG changeset patch
# User Dan
# Date 1194471206 18000
# Node ID 54392ae2c222f9069e6989accc2c18b9411069ff
# Parent 78a94f7bb5e3446bf5e8efb7f23cd5d8fb5a7a96# Parent 09f8a9a03ccfbab64466d00b7a1c97eb5e6d69ff
Merge changes from nighthawk and scribus back together
diff -r 78a94f7bb5e3 -r 54392ae2c222 includes/lang.php
--- a/includes/lang.php Tue Nov 06 16:40:19 2007 -0500
+++ b/includes/lang.php Wed Nov 07 16:33:26 2007 -0500
@@ -71,8 +71,8 @@
if ( defined('IN_ENANO_INSTALL') )
{
// special case for the Enano installer: it will load its own strings from a JSON file and just use this API for fetching and templatizing them.
- $this->lang_id = LANG_DEFAULT;
- $this->lang_code = 'neutral';
+ $this->lang_id = 1;
+ $this->lang_code = $lang;
return true;
}
if ( is_string($lang) )
@@ -186,6 +186,77 @@
}
/**
+ * Loads a JSON language file and parses the strings into RAM. Will use the cache if possible, but stays far away from the database,
+ * which we assume doesn't exist yet.
+ */
+
+ function load_file($file)
+ {
+ global $db, $session, $paths, $template, $plugins; // Common objects
+
+ if ( !file_exists($file) )
+ $db->_die('lang.php - requested JSON file doesn\'t exist');
+
+ $contents = trim(@file_get_contents($file));
+ if ( empty($contents) )
+ $db->_die('lang.php - empty language file...');
+
+ // Trim off all text before and after the starting and ending braces
+ $contents = preg_replace('/^([^{]+)\{/', '{', $contents);
+ $contents = preg_replace('/\}([^}]+)$/', '}', $contents);
+ $contents = trim($contents);
+
+ if ( empty($contents) )
+ $db->_die('lang.php - no meat to the language file...');
+
+ $checksum = md5($contents);
+ if ( file_exists("./cache/lang_json_{$checksum}.php") )
+ {
+ $this->load_cache_file("./cache/lang_json_{$checksum}.php");
+ }
+ else
+ {
+ $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE);
+ $langdata = $json->decode($contents);
+
+ if ( !is_array($langdata) )
+ $db->_die('lang.php - invalid language file');
+
+ if ( !isset($langdata['categories']) || !isset($langdata['strings']) )
+ $db->_die('lang.php - language file does not contain the proper items');
+
+ $this->merge($langdata['strings']);
+
+ $lang_file = "./cache/lang_json_{$checksum}.php";
+
+ $handle = @fopen($lang_file, 'w');
+ if ( !$handle )
+ // Couldn't open the file. Silently fail and let the strings come from RAM.
+ return false;
+
+ // The file's open, that means we should be good.
+ fwrite($handle, 'var_export_string($this->strings);
+ if ( empty($exported) )
+ // Ehh, that's not good
+ $db->_die('lang.php - load_file(): var_export_string() failed');
+
+ fwrite($handle, $exported . '; ?>');
+
+ // Clean up
+ unset($exported, $langdata);
+
+ // Done =)
+ fclose($handle);
+ }
+ }
+
+ /**
* Merges a standard language assoc array ($arr[cat][stringid]) with the master in RAM.
* @param array
*/
@@ -195,7 +266,7 @@
// This is stupidly simple.
foreach ( $strings as $cat_id => $contents )
{
- if ( !is_array($this->strings[$cat_id]) )
+ if ( !isset($this->strings[$cat_id]) || ( isset($this->strings[$cat_id]) && !is_array($this->strings[$cat_id]) ) )
$this->strings[$cat_id] = array();
foreach ( $contents as $string_id => $string )
{
@@ -364,6 +435,10 @@
if ( !$found )
{
// Ehh, the string wasn't found. Rerun fetch() and try again.
+ if ( defined('IN_ENANO_INSTALL') )
+ {
+ return $string_id;
+ }
$this->fetch();
if ( isset($this->strings[$category]) && isset($this->strings[$category][$string_name]) )
{
@@ -428,7 +503,7 @@
$subs[$key] = strval($value);
$string = str_replace("%{$key}%", "{$subs[$key]}", $string);
}
- return "L $string";
+ return "{$string}*";
}
} // class Language
diff -r 78a94f7bb5e3 -r 54392ae2c222 includes/template.php
--- a/includes/template.php Tue Nov 06 16:40:19 2007 -0500
+++ b/includes/template.php Wed Nov 07 16:33:26 2007 -0500
@@ -1894,13 +1894,14 @@
{
global $sideinfo;
global $this_page;
+ global $lang;
global $db, $session, $paths, $template, $plugins; // Common objects
$tplvars = $this->extract_vars('elements.tpl');
$tb = '';
// Get the "article" button text (depends on namespace)
- if(defined('IN_ENANO_INSTALL')) $ns = 'installation page';
+ if(defined('IN_ENANO_INSTALL')) $ns = $lang->get('meta_btn_article');
else $ns = 'system error page';
- $t = str_replace('{FLAGS}', 'onclick="if ( !KILL_SWITCH ) { return false; }" title="Hey! A button that doesn\'t do anything. Clever..." accesskey="a"', $tplvars['toolbar_button']);
+ $t = str_replace('{FLAGS}', 'onclick="return false;" title="Hey! A button that doesn\'t do anything. Clever..." accesskey="a"', $tplvars['toolbar_button']);
$t = str_replace('{HREF}', '#', $t);
$t = str_replace('{TEXT}', $ns, $t);
$tb .= $t;
@@ -1923,22 +1924,31 @@
$title = ( is_object($paths) ) ? $paths->page : 'Critical error';
+ $headers = '';
+
+ $js_dynamic = '';
+ if ( defined('IN_ENANO_INSTALL') )
+ {
+ $js_dynamic .= '';
+ }
+ $js_dynamic .= '';
+
// The rewritten template engine will process all required vars during the load_template stage instead of (cough) re-processing everything each time around.
$tpl_strings = Array(
'PAGE_NAME'=>$this_page,
'PAGE_URLNAME'=>'Null',
- 'SITE_NAME'=>'Enano Installation',
+ 'SITE_NAME'=>$lang->get('meta_site_name'),
'USERNAME'=>'admin',
- 'SITE_DESC'=>'Install Enano on your server.',
+ 'SITE_DESC'=>$lang->get('meta_site_desc'),
'TOOLBAR'=>$tb,
'SCRIPTPATH'=>scriptPath,
'CONTENTPATH'=>contentPath,
'ADMIN_SID_QUES'=>$asq,
'ADMIN_SID_AMP'=>$asa,
'ADMIN_SID_AMP_HTML'=>'',
- 'ADDITIONAL_HEADERS'=>'',
+ 'ADDITIONAL_HEADERS'=>$headers,
'SIDEBAR_EXTRA'=>'',
- 'COPYRIGHT'=>'Enano and all of its code, graphics, and more code is copyright © 2006 Dan Fuhry.
This program is Free Software; see the file "GPL" included with this package for details.',
+ 'COPYRIGHT'=>$lang->get('meta_enano_copyright'),
'TOOLBAR_EXTRAS'=>'',
'REQUEST_URI'=>( isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '' ).$_SERVER['REQUEST_URI'],
'STYLE_LINK'=>$slink,
@@ -1947,7 +1957,7 @@
'TEMPLATE_DIR'=>scriptPath.'/themes/'.$this->theme,
'THEME_ID'=>$this->theme,
'STYLE_ID'=>$this->style,
- 'JS_DYNAMIC_VARS'=>'',
+ 'JS_DYNAMIC_VARS'=>$js_dynamic,
'SIDEBAR_RIGHT'=>'',
);
$this->tpl_strings = array_merge($tpl_strings, $this->tpl_strings);
@@ -1964,7 +1974,7 @@
}
$p = $this->makeParserText($tplvars['sidebar_section']);
$p->assign_vars(Array(
- 'TITLE'=>'Installation progress',
+ 'TITLE'=>$lang->get('meta_sidebar_heading'),
'CONTENT'=>$sidebar,
));
$sidebar = $p->run();
diff -r 78a94f7bb5e3 -r 54392ae2c222 install.php
--- 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 "
$desc | |
";
+ echo "$desc | |
";
} elseif(!$val && $warn) {
if($cv) $color='FFFFCC'; else $color='FFFFAA';
- echo "$desc $extended_desc | |
";
+ echo "$desc $extended_desc | |
";
$warned = true;
} else {
if($cv) $color='FFCCCC'; else $color='FFAAAA';
- echo "$desc $extended_desc | |
";
+ echo "$desc $extended_desc | |
";
$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 <<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 @@
?>
-
Welcome to Enano
-
version 1.1.1 – unstable
+
get('welcome_heading'); ?>
+
+ get("welcome_branch_$branch");
+
+ $v_string = sprintf('%s %s – %s', $lang->get('welcome_version'), ENANO_VERSION, $branch_l);
+ echo $v_string;
+ ?>
+
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.
';
- }
+ if ( defined('ENANO_CODE_NAME') )
+ {
+ echo '';
+ echo $lang->get('welcome_aka', array(
+ 'codename' => strtolower(ENANO_CODE_NAME)
+ ));
+ echo '
';
+ }
?>
- 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.
+ get('license_heading'); ?>
+ get('license_blurb_thankyou'); ?>
+ get('license_blurb_pleaseread'); ?>
-
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.
+
get('license_info_unstable_title'); ?>
+
get('license_info_unstable_body'); ?>
-
Lawyer-readable version
+
get('license_section_gpl_heading'); ?>
+ lang_code != 'eng' ): ?>
+
get('license_gpl_blurb_inenglish'); ?>
+
@@ -927,19 +989,18 @@
case "sysreqs":
error_reporting(E_ALL);
?>
-
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.
+
get('sysreqs_heading'); ?>
+
get('sysreqs_blurb'); ?>
=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);
+ 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 '
';
if(!$failed)
{
@@ -949,27 +1010,39 @@
';
- 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);
+ run_test('return false;', $lang->get('sysreqs_summary_warn_title'), $lang->get('sysreqs_summary_warn_body'), 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!');
+ run_test('return true;', '' . $lang->get('sysreqs_summary_success_title') . '
' . $lang->get('sysreqs_summary_success_body'), '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.');
+ run_test('return false;', $lang->get('sysreqs_summary_fail_title'), $lang->get('sysreqs_summary_fail_body'));
echo '
';
}
}
@@ -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 = '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 = '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 = 'Error:<\/b> The database server "'+document.forms.dbinfo.db_host.value+'" couldn\'t be contacted.
'+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 = 'Error:<\/b> Access to MySQL under the specified credentials was denied.
'+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 = 'Error:<\/b> Access to the specified database using those login credentials was denied.
'+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 = 'Error:<\/b> The specified database does not exist
'+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 = 'Error:<\/b> Access to MySQL under the specified credentials was denied.
'+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 = '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 = '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 = '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;
- 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.
+ get('database_blurb_needdb'); ?>
+ get('database_blurb_howtomysql'); ?>
MySQL login information for this virtual appliance:
Database hostname: localhost
Database login: username "enano", password: "clurichaun" (without quotes)
Database name: enano_www1';
+ echo '
+ ' . $lang->get('database_vm_login_info', array( 'host' => 'localhost', 'user' => 'enano', 'pass' => 'clurichaun', 'name' => 'enano_www1' )) . '
+
';
}
?>
restart the installation.';
$template->footer();
exit;
@@ -1272,7 +1450,7 @@
@@ -1385,7 +1563,7 @@
@@ -1498,7 +1676,7 @@
diff -r 78a94f7bb5e3 -r 54392ae2c222 language/english/install.json
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/language/english/install.json Wed Nov 07 16:33:26 2007 -0500
@@ -0,0 +1,151 @@
+/*
+ * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
+ * Version 1.1.1
+ * Copyright (C) 2006-2007 Dan Fuhry
+ *
+ * This program is Free Software; you can redistribute 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 for details.
+ */
+
+// Enano installer strings
+// Language: ISO-639-3 eng (English)
+
+var enano_lang_install = {
+ categories: [
+ 'meta', 'welcome', 'license', 'sysreqs', 'database', 'website', 'login', 'confirm', 'install', 'finish', 'pophelp',
+ ],
+ strings: {
+ meta: {
+ site_name: 'Enano installation',
+ site_desc: 'Install Enano on your server.',
+ enano_copyright: 'Enano and all of its code, graphics, and more code is copyright © 2006 Dan Fuhry.
This program is Free Software; see the file "GPL" included with this package for details.',
+ sidebar_heading: 'Installation progress',
+ btn_article: 'installation page',
+ btn_continue: 'Continue',
+ lbl_before_continue: 'Before continuing:',
+
+ msg_err_verification: 'One or more of the form fields is incorrect. Please correct any information in the form that has an "X" next to it.',
+
+ },
+ welcome: {
+ modetitle: 'Welcome',
+ heading: 'Welcome to Enano',
+ version: 'version',
+ branch_stable: 'stable',
+ branch_unstable: 'unstable',
+ aka: 'also affectionately known as "%codename%" :)',
+ btn_start: 'Start installation',
+ },
+ license: {
+ modetitle: 'License agreement',
+ heading: 'Welcome to the Enano installer.',
+ blurb_thankyou: '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.',
+ blurb_pleaseread: 'To get started, please read and accept the following license agreement. You\'ve probably seen it before.',
+ info_unstable_title: 'Notice for prerelease versions',
+ info_unstable_body: '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.',
+ section_gpl_heading: 'Lawyer-readable version',
+ btn_i_agree: 'I agree to the license terms',
+ objective_ensure_agree: 'Ensure that you agree with the terms of the license',
+ objective_have_db_info: 'Have your database host, name, username, and password available',
+ gpl_blurb_inenglish: 'You may view a copy of the GNU General Public License in English in the file GPL-EN included with this package.',
+ },
+ sysreqs: {
+ modetitle: 'Server requirements',
+ heading: 'Checking your server',
+ blurb: '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.',
+ req_php: 'PHP Version >=4.3.0',
+ req_mysql: 'MySQL extension for PHP',
+ req_uploads: 'File upload support',
+ req_apache: 'Apache HTTP Server',
+ req_config: 'Configuration file writable',
+ req_magick: 'ImageMagick support',
+ req_cachewriteable: 'Cache directory writable',
+ req_fileswriteable: 'File uploads directory writable',
+
+ req_desc_php: '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.',
+ req_desc_mysql: '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.',
+ req_desc_uploads: '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".',
+ req_desc_apache: '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.',
+ req_desc_config: '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.',
+ req_desc_magick: '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.',
+ req_desc_cachewriteable: '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.',
+ req_desc_fileswriteable: '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.',
+
+ summary_success_title: 'Your server meets all the requirements for running Enano.',
+ summary_success_body: 'Click the button below to continue the installation.',
+
+ summary_warn_title: 'Some of the features of Enano have been turned off to accommodate your server.',
+ summary_warn_body: '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, Enano has disabled these features as a precaution to prevent errors and potential security issues.',
+
+ summary_fail_title: 'Your server does not meet the requirements for Enano to run.',
+ summary_fail_body: '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.',
+
+ objective_scalebacks: 'Review the list above to ensure that you are satisfied with any of Enano\'s workarounds for your server. If you need a particular feature and that feature is listed as disabled above, you should take the opportunity now to correct the problem.'
+ },
+ database: {
+ modetitle: 'Database information',
+ heading_optionalinfo: 'Optional information',
+
+ msg_err_mysql_connect: 'Error: The database server "%db_host%" couldn\'t be contacted.
%mysql_error%',
+ msg_err_mysql_auth: 'Error: Access to MySQL under the specified credentials was denied.
%mysql_error%',
+ msg_err_mysql_dbperm: 'Error: Access to the specified database using those login credentials was denied.
%mysql_error%',
+ msg_err_mysql_dbexist: 'Error: The specified database does not exist
%mysql_error%',
+ msg_err_mysql_version: 'Error: Your version of MySQL (%mysql_version%) 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().',
+
+ msg_warn_creating_db: 'Warning: The database you specified does not exist. It will be created during installation.',
+ msg_warn_creating_user: 'Warning: 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.',
+ msg_warn_mysql_version: 'The MySQL version that your server is running could not be determined.',
+
+ msg_info_mysql_good: 'Your version of MySQL meets Enano requirements.',
+
+ blurb_needdb: '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.',
+ blurb_howtomysql: '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.',
+
+ vm_login_info: 'MySQL login information for this virtual appliance:
Database hostname: %host%
Database login: username "%user%", password: "%pass%" (without quotes)
Database name: %name%',
+
+ table_title: 'Database information',
+
+ field_hostname_title: 'Database hostname',
+ field_hostname_body: 'This is the hostname (or sometimes the IP address) of your MySQL server. In many cases, this is "localhost".',
+ field_dbname_title: 'Database name',
+ field_dbname_body: '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.',
+ field_dbauth_title: 'Database login',
+ field_dbauth_body: 'These fields should be the username and password of a user with "select", "insert", "update", "delete", "create table", and "replace" privileges for your database.',
+ field_tableprefix_title: 'Table prefix',
+ field_tableprefix_body: '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 (_).',
+ field_rootauth_title: 'Database administrative login',
+ field_rootauth_body: '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.',
+ field_mysqlversion_title: 'MySQL version',
+ field_mysqlversion_blurb_willbechecked: 'MySQL version information will be checked when you click "Test Connection".',
+ field_droptables_title: 'Delete existing tables?',
+ field_droptables_body: '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.',
+ field_droptables_lbl: 'Drop existing tables',
+
+ btn_testconnection: 'Test connection',
+
+ objective_test: 'Check your MySQL connection using the "Test Connection" button.',
+ objective_uncrypt: 'Be aware that your database information will be transmitted unencrypted several times.',
+ },
+ website: {
+ modetitle: 'Website configuration',
+ },
+ login: {
+ modetitle: 'Administration login',
+ },
+ confirm: {
+ modetitle: 'Confirm installation',
+ },
+ install: {
+ modetitle: 'Database installation',
+ },
+ finish: {
+ modetitle: 'Installation complete',
+ },
+ pophelp: {
+ }
+ }
+
+}
diff -r 78a94f7bb5e3 -r 54392ae2c222 language/english/install/license-deed.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/language/english/install/license-deed.html Wed Nov 07 16:33:26 2007 -0500
@@ -0,0 +1,25 @@
+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
+