# HG changeset patch
# User Dan
# Date 1200509749 18000
# Node ID 87e08a6e4fec6b7ba8205968c7022298fbbc36b2
# Parent 299a90e28abcc4299b5f6e9fe68eb700ea9d94c7
Welcome to the new Enano installer. Much distance still to be covered but the basics are there.
diff -r 299a90e28abc -r 87e08a6e4fec images/about-powered-pgsql.png
Binary file images/about-powered-pgsql.png has changed
diff -r 299a90e28abc -r 87e08a6e4fec images/enano-artwork/README
--- a/images/enano-artwork/README Thu Jan 03 18:39:19 2008 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-The images in this directory are copyright (C) 2007 Dan Fuhry. Except
-as permitted by applicable law, they may not be used in any way other
-than to promote the unmodified Enano CMS. You also may not modify and
-then distribute the images in this directory, or distribute them sep-
-arately from the Enano packages. The goal here is to establish a uni-
-que identity for Enano through the use of a logo, and that identity
-would be confused if this logo is used for unofficial Enano distros.
-
diff -r 299a90e28abc -r 87e08a6e4fec images/enano-artwork/installer-greeting-blue.png
Binary file images/enano-artwork/installer-greeting-blue.png has changed
diff -r 299a90e28abc -r 87e08a6e4fec images/enano-artwork/installer-greeting-green.png
Binary file images/enano-artwork/installer-greeting-green.png has changed
diff -r 299a90e28abc -r 87e08a6e4fec includes/clientside/static/editor.js
--- a/includes/clientside/static/editor.js Thu Jan 03 18:39:19 2008 -0500
+++ b/includes/clientside/static/editor.js Wed Jan 16 13:55:49 2008 -0500
@@ -33,7 +33,7 @@
{
if ( typeof(tinyMCE) == 'object' )
{
- if ( !KILL_SWITCH )
+ if ( !KILL_SWITCH && !DISABLE_MCE )
{
tinyMCE.init(enano_tinymce_options);
}
diff -r 299a90e28abc -r 87e08a6e4fec includes/clientside/static/enano-lib-basic.js
--- a/includes/clientside/static/enano-lib-basic.js Thu Jan 03 18:39:19 2008 -0500
+++ b/includes/clientside/static/enano-lib-basic.js Wed Jan 16 13:55:49 2008 -0500
@@ -63,6 +63,11 @@
// dummy tinyMCE object
var tinyMCE = new Object();
+if ( typeof(DISABLE_MCE) == undefined )
+{
+ var DISABLE_MCE = false;
+}
+
// Obsolete JSON kill switch
function disableJSONExts() { };
@@ -251,7 +256,7 @@
}
var head = document.getElementsByTagName('head')[0];
-if ( !KILL_SWITCH )
+if ( !KILL_SWITCH && !DISABLE_MCE )
{
var script = document.createElement('script');
script.type="text/javascript";
diff -r 299a90e28abc -r 87e08a6e4fec includes/clientside/static/misc.js
--- a/includes/clientside/static/misc.js Thu Jan 03 18:39:19 2008 -0500
+++ b/includes/clientside/static/misc.js Wed Jan 16 13:55:49 2008 -0500
@@ -565,32 +565,8 @@
disableJSONExts();
- //
- // Encryption test
- //
+ var auth_enabled = aes_self_test();
- var str = '';
- for(i=0;i It seems that the Enano release we\'re trying to run ('.$version.') is different from the version specified in your database ('.enano_version().'). Perhaps you need to upgrade? Error: couldn\'t connect to MySQL. Error: couldn\'t connect to PostgreSQL.
'.mysql_error().'
'.pg_last_error().'
' . htmlspecialchars(print_r($e, true)) . '
'); + exit; + } if ( !is_array($langdata) ) $db->_die('lang.php - invalid language file'); diff -r 299a90e28abc -r 87e08a6e4fec includes/rijndael.php --- a/includes/rijndael.php Thu Jan 03 18:39:19 2008 -0500 +++ b/includes/rijndael.php Wed Jan 16 13:55:49 2008 -0500 @@ -126,7 +126,7 @@ $this->debug = $debug; } - function singleton($key_size, $block_size) + public static function singleton($key_size, $block_size) { global $_aes_objcache; if ( isset($_aes_objcache["$key_size,$block_size"]) ) diff -r 299a90e28abc -r 87e08a6e4fec install.php --- a/install.php Thu Jan 03 18:39:19 2008 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2470 +0,0 @@ -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.
'); - exit; -} - -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 -define("ENANO_ALLOW_LOAD_NOLANG", 1); - -if(!defined('scriptPath')) { - $sp = dirname($_SERVER['REQUEST_URI']); - if($sp == '/' || $sp == '\\') $sp = ''; - define('scriptPath', $sp); -} - -if(!defined('contentPath')) { - $sp = dirname($_SERVER['REQUEST_URI']); - if($sp == '/' || $sp == '\\') $sp = ''; - define('contentPath', $sp); -} -global $_starttime, $this_page, $sideinfo; -$_starttime = microtime(true); - -global $db; - -// Determine directory (special case for development servers) -if ( strpos(__FILE__, '/repo/') && file_exists('.enanodev') ) -{ - $filename = str_replace('/repo/', '/', __FILE__); -} -else -{ - $filename = __FILE__; -} - -define('ENANO_ROOT', dirname($filename)); - -function is_page($p) -{ - return true; -} - -function microtime_float() -{ - list($usec, $sec) = explode(" ", microtime()); - return ((float)$usec + (float)$sec); -} - -require('includes/wikiformat.php'); -require('includes/constants.php'); -require('includes/rijndael.php'); -require('includes/functions.php'); -require('includes/dbal.php'); -require('includes/lang.php'); -require('includes/json.php'); - -// Initialize language support -$lang = new Language('eng'); -$lang->load_file('./language/english/install.json'); - -strip_magic_quotes_gpc(); - -// -// INSTALLER LIBRARY -// - -$neutral_color = 'C'; - -function run_installer_stage($stage_id, $stage_name, $function, $failure_explanation, $allow_skip = true) -{ - static $resumed = false; - static $resume_stack = array(); - - if ( empty($resume_stack) && isset($_POST['resume_stack']) && preg_match('/[a-z_]+((\|[a-z_]+)+)/', $_POST['resume_stack']) ) - { - $resume_stack = explode('|', $_POST['resume_stack']); - } - - $already_run = false; - if ( in_array($stage_id, $resume_stack) ) - { - $already_run = true; - } - - if ( !$resumed ) - { - if ( !isset($_GET['stage']) ) - $resumed = true; - if ( isset($_GET['stage']) && $_GET['stage'] == $stage_id ) - { - $resumed = true; - } - } - if ( !$resumed && $allow_skip ) - { - echo_stage_success($stage_id, $stage_name); - return false; - } - if ( !function_exists($function) ) - die('libenanoinstall: CRITICAL: function "' . $function . '" for ' . $stage_id . ' doesn\'t exist'); - $result = @call_user_func($function, false, $already_run); - if ( $result ) - { - echo_stage_success($stage_id, $stage_name); - $resume_stack[] = $stage_id; - return true; - } - else - { - echo_stage_failure($stage_id, $stage_name, $failure_explanation, $resume_stack); - return false; - } -} - -function start_install_table() -{ - echo 'SECURITY: malformed database name \"$db_name\"
"); - } - - // First, try to connect using the normal credentials - $conn = @mysql_connect($_POST['db_host'], $_POST['db_user'], $_POST['db_pass']); - if ( !$conn ) - { - // Connection failed. Do we have the root username and password? - if ( !empty($_POST['db_root_user']) && !empty($_POST['db_root_pass']) ) - { - $conn_root = @mysql_connect($_POST['db_host'], $_POST['db_root_user'], $_POST['db_root_pass']); - if ( !$conn_root ) - { - // Couldn't connect using either set of credentials. Bail out. - return false; - } - unset($db_user, $db_pass); - $db_user = mysql_real_escape_string($_POST['db_user']); - $db_pass = mysql_real_escape_string($_POST['db_pass']); - // Create the user account - $q = @mysql_query("GRANT ALL PRIVILEGES ON test.* TO '{$db_user}'@'localhost' IDENTIFIED BY '$db_pass' WITH GRANT OPTION;", $conn_root); - if ( !$q ) - { - return false; - } - // Revoke privileges from test, we don't need them - $q = @mysql_query("REVOKE ALL PRIVILEGES ON test.* FROM '{$db_user}'@'localhost';", $conn_root); - if ( !$q ) - { - return false; - } - if ( $_POST['db_host'] != 'localhost' && $_POST['db_host'] != '127.0.0.1' && $_POST['db_host'] != '::1' ) - { - // If not connecting to a server running on localhost, allow from any host - // this is safer than trying to detect the hostname of the webserver, but less secure - $q = @mysql_query("GRANT ALL PRIVILEGES ON test.* TO '{$db_user}'@'%' IDENTIFIED BY '$db_pass' WITH GRANT OPTION;", $conn_root); - if ( !$q ) - { - return false; - } - // Revoke privileges from test, we don't need them - $q = @mysql_query("REVOKE ALL PRIVILEGES ON test.* FROM '{$db_user}'@'%';", $conn_root); - if ( !$q ) - { - return false; - } - } - mysql_close($conn_root); - $conn = @mysql_connect($_POST['db_host'], $_POST['db_user'], $_POST['db_pass']); - if ( !$conn ) - { - // This should honestly never happen. - return false; - } - } - } - $q = @mysql_query("USE `$db_name`;", $conn); - if ( !$q ) - { - // access denied to the database; try the whole root schenanegan again - if ( !empty($_POST['db_root_user']) && !empty($_POST['db_root_pass']) ) - { - $conn_root = @mysql_connect($_POST['db_host'], $_POST['db_root_user'], $_POST['db_root_pass']); - if ( !$conn_root ) - { - // Couldn't connect as root; bail out - return false; - } - // create the database, if it doesn't exist - $q = @mysql_query("CREATE DATABASE IF NOT EXISTS `$db_name`;", $conn_root); - if ( !$q ) - { - // this really should never fail, so don't give any tolerance to it - return false; - } - unset($db_user, $db_pass); - $db_user = mysql_real_escape_string($_POST['db_user']); - $db_pass = mysql_real_escape_string($_POST['db_pass']); - // we're in with root rights; grant access to the database - $q = @mysql_query("GRANT ALL PRIVILEGES ON `$db_name`.* TO '{$db_user}'@'localhost';", $conn_root); - if ( !$q ) - { - return false; - } - if ( $_POST['db_host'] != 'localhost' && $_POST['db_host'] != '127.0.0.1' && $_POST['db_host'] != '::1' ) - { - $q = @mysql_query("GRANT ALL PRIVILEGES ON `$db_name`.* TO '{$db_user}'@'%';", $conn_root); - if ( !$q ) - { - return false; - } - } - mysql_close($conn_root); - // grant tables have hopefully been flushed, kill and reconnect our regular user connection - mysql_close($conn); - $conn = @mysql_connect($_POST['db_host'], $_POST['db_user'], $_POST['db_pass']); - if ( !$conn ) - { - return false; - } - } - else - { - return false; - } - // try again - $q = @mysql_query("USE `$db_name`;", $conn); - if ( !$q ) - { - // really failed this time; bail out - return false; - } - } - // initialize DBAL - $db->connect(true, $_POST['db_host'], $db_user, $db_pass, $db_name); - // connected and database exists - return true; -} - -function stg_pgsql_connect($act_get = false) -{ - global $db; - $db = new postgresql(); - - static $conn = false; - if ( $act_get ) - return $conn; - - $db_user =& $_POST['db_user']; - $db_pass =& $_POST['db_pass']; - $db_name =& $_POST['db_name']; - - if ( !preg_match('/^[a-z0-9_-]+$/', $db_name) ) - { - $db_name = htmlspecialchars($db_name); - die("SECURITY: malformed database name \"$db_name\"
"); - } - - // First, try to connect using the normal credentials - $conn = @pg_connect("host={$_POST['db_host']} port=5432 user={$_POST['db_user']} password={$_POST['db_pass']}"); - if ( !$conn ) - { - // Connection failed. Do we have the root username and password? - if ( !empty($_POST['db_root_user']) && !empty($_POST['db_root_pass']) ) - { - $conn_root = @pg_connect("host={$_POST['db_host']} port=5432 user={$_POST['db_root_user']} password={$_POST['db_root_pass']}"); - if ( !$conn_root ) - { - // Couldn't connect using either set of credentials. Bail out. - return false; - } - unset($db_user, $db_pass); - $db_user = pg_escape_string($_POST['db_user']); - $db_pass = pg_escape_string($_POST['db_pass']); - // Create the user account - $q = @pg_query("CREATE ROLE '$db_user' WITH NOSUPERUSER UNENCRYPTED PASSWORD '$db_pass';", $conn_root); - if ( !$q ) - { - return false; - } - pg_close($conn_root); - $conn = @pg_connect("host={$_POST['db_host']} port=5432 user={$_POST['db_user']} password={$_POST['db_pass']}"); - if ( !$conn ) - { - // This should honestly never happen. - return false; - } - } - } - if ( !$q ) - { - // access denied to the database; try the whole root schenanegan again - if ( !empty($_POST['db_root_user']) && !empty($_POST['db_root_pass']) ) - { - $conn_root = @pg_connect("host={$_POST['db_host']} port=5432 user={$_POST['db_root_user']} password={$_POST['db_root_pass']}"); - if ( !$conn_root ) - { - // Couldn't connect as root; bail out - return false; - } - unset($db_user, $db_pass); - $db_user = pg_escape_string($_POST['db_user']); - $db_pass = pg_escape_string($_POST['db_pass']); - // create the database, if it doesn't exist - $q = @mysql_query("CREATE DATABASE $db_name WITH OWNER $db_user;", $conn_root); - if ( !$q ) - { - // this really should never fail, so don't give any tolerance to it - return false; - } - // Setting the owner to $db_user should grant all the rights we need - pg_close($conn_root); - // grant tables have hopefully been flushed, kill and reconnect our regular user connection - pg_close($conn); - $conn = @pg_connect("host={$_POST['db_host']} port=5432 user={$_POST['db_user']} password={$_POST['db_pass']}"); - if ( !$conn ) - { - return false; - } - } - else - { - return false; - } - // try again - $q = @mysql_query("USE `$db_name`;", $conn); - if ( !$q ) - { - // really failed this time; bail out - return false; - } - } - // initialize DBAL - $db->connect(true, $_POST['db_host'], $db_user, $db_pass, $db_name); - // connected and database exists - return true; -} - -function stg_drop_tables() -{ - global $db; - // Our list of tables included in Enano - $tables = Array( 'categories', 'comments', 'config', 'logs', 'page_text', 'session_keys', 'pages', 'users', 'users_extra', 'themes', 'buddies', 'banlist', 'files', 'privmsgs', 'sidebar', 'hits', 'search_index', 'groups', 'group_members', 'acl', 'tags', 'page_groups', 'page_group_members' ); - - // Drop each table individually; if it fails, it probably means we're trying to drop a - // table that didn't exist in the Enano version we're deleting the database for. - foreach ( $tables as $table ) - { - // Remember that table_prefix is sanitized. - $table = "{$_POST['table_prefix']}$table"; - $db->sql_query("DROP TABLE $table;", $conn); - } - return true; -} - -function stg_decrypt_admin_pass($act_get = false) -{ - static $decrypted_pass = false; - if ( $act_get ) - return $decrypted_pass; - - $aes = AESCrypt::singleton(AES_BITS, AES_BLOCKSIZE); - - if ( !empty($_POST['crypt_data']) ) - { - require('config.new.php'); - if ( !isset($cryptkey) ) - { - return false; - } - define('_INSTRESUME_AES_KEYBACKUP', $key); - $key = hexdecode($cryptkey); - - $decrypted_pass = $aes->decrypt($_POST['crypt_data'], $key, ENC_HEX); - - } - else - { - $decrypted_pass = $_POST['admin_pass']; - } - if ( empty($decrypted_pass) ) - return false; - return true; -} - -function stg_generate_aes_key($act_get = false) -{ - static $key = false; - if ( $act_get ) - return $key; - - $aes = AESCrypt::singleton(AES_BITS, AES_BLOCKSIZE); - $key = $aes->gen_readymade_key(); - return true; -} - -function stg_parse_schema($act_get = false) -{ - static $schema; - if ( $act_get ) - return $schema; - - global $db; - - $admin_pass = stg_decrypt_admin_pass(true); - $key = stg_generate_aes_key(true); - $aes = AESCrypt::singleton(AES_BITS, AES_BLOCKSIZE); - $key = $aes->hextostring($key); - $admin_pass = $aes->encrypt($admin_pass, $key, ENC_HEX); - - $cacheonoff = is_writable(ENANO_ROOT.'/cache/') ? '1' : '0'; - - $admin_user = $_POST['admin_user']; - $admin_user = str_replace('_', ' ', $admin_user); - $admin_user = $db->escape($admin_user); - - switch ( $_POST['db_driver'] ) - { - case 'mysql': - $schema_file = 'schema.sql'; - break; - case 'postgresql': - $schema_file = 'schema-pg.sql'; - break; - } - - if ( !isset($schema_file) ) - die('insanity'); - - $schema = file_get_contents($schema_file); - $schema = str_replace('{{SITE_NAME}}', $db->escape($_POST['sitename'] ), $schema); - $schema = str_replace('{{SITE_DESC}}', $db->escape($_POST['sitedesc'] ), $schema); - $schema = str_replace('{{COPYRIGHT}}', $db->escape($_POST['copyright'] ), $schema); - $schema = str_replace('{{ADMIN_USER}}', $admin_user , $schema); - $schema = str_replace('{{ADMIN_PASS}}', $db->escape($admin_pass ), $schema); - $schema = str_replace('{{ADMIN_EMAIL}}', $db->escape($_POST['admin_email']), $schema); - $schema = str_replace('{{ENABLE_CACHE}}', $db->escape($cacheonoff ), $schema); - $schema = str_replace('{{REAL_NAME}}', '', $schema); - $schema = str_replace('{{TABLE_PREFIX}}', $_POST['table_prefix'], $schema); - $schema = str_replace('{{VERSION}}', ENANO_VERSION, $schema); - $schema = str_replace('{{ADMIN_EMBED_PHP}}', $_POST['admin_embed_php'], $schema); - // Not anymore!! :-D - // $schema = str_replace('{{BETA_VERSION}}', ENANO_BETA_VERSION, $schema); - - if(isset($_POST['wiki_mode'])) - { - $schema = str_replace('{{WIKI_MODE}}', '1', $schema); - } - else - { - $schema = str_replace('{{WIKI_MODE}}', '0', $schema); - } - - // Build an array of queries - $schema = explode("\n", $schema); - - foreach ( $schema as $i => $sql ) - { - $query =& $schema[$i]; - $t = trim($query); - if ( empty($t) || preg_match('/^(\#|--)/i', $t) ) - { - unset($schema[$i]); - unset($query); - } - } - - $schema = array_values($schema); - $schema = implode("\n", $schema); - $schema = explode(";\n", $schema); - - foreach ( $schema as $i => $sql ) - { - $query =& $schema[$i]; - if ( substr($query, ( strlen($query) - 1 ), 1 ) != ';' ) - { - $query .= ';'; - } - } - - return true; -} - -function stg_install($_unused, $already_run) -{ - // This one's pretty easy. - $conn = stg_mysql_connect(true); - if ( !is_resource($conn) ) - return false; - $schema = stg_parse_schema(true); - if ( !is_array($schema) ) - return false; - - // If we're resuming installation, the encryption key was regenerated. - // This means we'll have to update the encrypted password in the database. - if ( $already_run ) - { - $admin_pass = stg_decrypt_admin_pass(true); - $key = stg_generate_aes_key(true); - $aes = AESCrypt::singleton(AES_BITS, AES_BLOCKSIZE); - $key = $aes->hextostring($key); - $admin_pass = $aes->encrypt($admin_pass, $key, ENC_HEX); - $admin_user = mysql_real_escape_string($_POST['admin_user']); - $admin_user = str_replace('_', ' ', $admin_user); - - $q = @mysql_query("UPDATE {$_POST['table_prefix']}users SET password='$admin_pass' WHERE username='$admin_user';"); - if ( !$q ) - { - echo 'MySQL return: ' . mysql_error() . '
'; - return false; - } - - return true; - } - - // OK, do the loop, baby!!! - foreach($schema as $q) - { - $r = mysql_query($q, $conn); - if ( !$r ) - { - echo 'MySQL return: ' . mysql_error() . '
'; - return false; - } - } - - return true; -} - -function stg_write_config() -{ - $privkey = stg_generate_aes_key(true); - - switch($_POST['urlscheme']) - { - case "ugly": - default: - $cp = scriptPath.'/index.php?title='; - break; - case "short": - $cp = scriptPath.'/index.php/'; - break; - case "tiny": - $cp = scriptPath.'/'; - break; - } - - if ( $_POST['urlscheme'] == 'tiny' ) - { - $contents = '# Begin Enano rules -RewriteEngine on -RewriteCond %{REQUEST_FILENAME} !-d -RewriteCond %{REQUEST_FILENAME} !-f -RewriteRule ^(.+) '.scriptPath.'/index.php?title=$1 [L,QSA] -RewriteRule \.(php|html|gif|jpg|png|css|js)$ - [L] -# End Enano rules -'; - if ( file_exists('./.htaccess') ) - $ht = fopen(ENANO_ROOT.'/.htaccess', 'a+'); - else - $ht = fopen(ENANO_ROOT.'/.htaccess.new', 'w'); - if ( !$ht ) - return false; - fwrite($ht, $contents); - fclose($ht); - } - - $config_file = ''; - - $cf_handle = fopen(ENANO_ROOT.'/config.new.php', 'w'); - if ( !$cf_handle ) - return false; - fwrite($cf_handle, $config_file); - - fclose($cf_handle); - - return true; -} - -function _stg_rename_config_revert() -{ - if ( file_exists('./config.php') ) - { - @rename('./config.php', './config.new.php'); - } - - $handle = @fopen('./config.php.new', 'w'); - if ( !$handle ) - return false; - $contents = ''; - fwrite($handle, $contents); - fclose($handle); - return true; -} - -function stg_build_index() -{ - global $db, $session, $paths, $template, $plugins; // Common objects; - if ( $paths->rebuild_search_index() ) - return true; - return false; -} - -function stg_rename_config() -{ - if ( !@rename('./config.new.php', './config.php') ) - { - echo 'Can\'t rename config.php
'; - _stg_rename_config_revert(); - return false; - } - - if ( $_POST['urlscheme'] == 'tiny' && !file_exists('./.htaccess') ) - { - if ( !@rename('./.htaccess.new', './.htaccess') ) - { - echo 'Can\'t rename .htaccess
'; - _stg_rename_config_revert(); - return false; - } - } - return true; -} - -function stg_start_api_success() -{ - return true; -} - -function stg_start_api_failure() -{ - return false; -} - -function stg_import_language() -{ - global $db, $session, $paths, $template, $plugins; // Common objects - - $lang_file = ENANO_ROOT . "/language/english/enano.json"; - install_language("eng", "English", "English", $lang_file); - - return true; -} - -function stg_init_logs() -{ - global $db, $session, $paths, $template, $plugins; // Common objects - - $q = $db->sql_query('INSERT INTO ' . table_prefix . 'logs(log_type,action,time_id,date_string,author,page_text,edit_summary) VALUES(\'security\', \'install_enano\', ' . time() . ', \'' . enano_date('d M Y h:i a') . '\', \'' . mysql_real_escape_string($_POST['admin_user']) . '\', \'' . mysql_real_escape_string(ENANO_VERSION) . '\', \'' . mysql_real_escape_string($_SERVER['REMOTE_ADDR']) . '\');'); - if ( !$q ) - { - echo 'MySQL return: ' . mysql_error() . '
'; - return false; - } - - if ( !$session->get_permissions('clear_logs') ) - { - echo '$session: denied clear_logs
'; - return false; - } - - PageUtils::flushlogs('Main_Page', 'Article'); - - return true; -} - -//die('Key size: ' . AES_BITS . '([\s]*?)<\/p>#is', '', $result);
- $result = preg_replace('#
([\s]*?)
$desc | "; - } elseif(!$val && $warn) { - if($cv) $color='FFFFCC'; else $color='FFFFAA'; - echo " |
$desc $extended_desc | |
$desc $extended_desc |
The next step is to choose the database driver that Enano will use. In most cases this is MySQL, but there are certain - advantages to PostgreSQL, which is made available only experimentally.
'; - if ( @file_exists('/etc/enano-is-virt-appliance') ) - { - echo 'You\'re using the Enano virtual appliance.
Unless you configured the appliance manually, PostgreSQL support is not available. In 99% of cases you\'ll want to click MySQL below.
ERROR: Despite my repeated attempts to verify that the configuration file can be written, I was indeed prevented from opening it for writing. Maybe you\'re still on crack Windows?
' . $lang->get('install_msg_complete_body', array('finish_link' => 'install.php?mode=finish')) . '
'; - - // echo ''; - - break; - case "finish": - echo '' . $lang->get('finish_link_mainpage', array('mainpage_link' => 'index.php')) . '
'; - break; - // this stage is never shown during the installation, but is provided for legal purposes - case "showlicense": - show_license(true); - break; -} -$template->footer(); - -?> diff -r 299a90e28abc -r 87e08a6e4fec install/.htaccess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/install/.htaccess Wed Jan 16 13:55:49 2008 -0500 @@ -0,0 +1,8 @@ +# Used for testing mod_rewrite. + +RewriteEngine on + +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule (.*) install.php?do=modrewrite_test&str=$1 + diff -r 299a90e28abc -r 87e08a6e4fec install/images/balancer.png Binary file install/images/balancer.png has changed diff -r 299a90e28abc -r 87e08a6e4fec install/images/css/installer.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/install/images/css/installer.css Wed Jan 16 13:55:49 2008 -0500 @@ -0,0 +1,231 @@ +/* + * 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 + * Installation package + * installer.css - visual styling rules for the installer + * + * 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. + */ + +body { + font-family: DejaVu Sans, Arial, Helvetica, sans-serif; + font-size: 9pt; + margin: 0; + padding: 0; +} + +div#header { + margin: 0px auto; + width: 800px; + padding: 10px 0; +} + +div#step { + float: right; + font-size: 12pt; + color: #D84308; + line-height: 48px; + background-image: url(../icons/install.png); + background-position: right center; + background-repeat: no-repeat; + padding-right: 56px; + margin: 10px 0 0 0; +} + +div.stages-holder { + color: #ffffff; + background-color: #2f527a; + width: 100%; +} + +ul.stages { + margin: 0; + line-height: 24px; + font-size: 8pt; + padding: 0; +} +ul.stages-fixed { + /* + width: 840px; + */ + display: table; + margin: 0 auto; +} +li.stage { + list-style-type: none; + float: left; + text-align: center; + padding: 3px 20px 3px 20px; +} +li.stage-active { + font-weight: bold; + padding: 1px 20px 5px 20px; + background-image: url(../marker.gif); + background-position: center bottom; + background-repeat: no-repeat; + background-color: #5f82aa; +} +div#enano-fill { + background-image: url(../substages.png); + background-repeat: repeat-x; +} +div#enano-body { + width: 780px; + padding: 10px; + margin: 0 auto; +} +div#enano-body a { + color: #003366; + text-decoration: underline; +} +div#enano-body a:hover { + color: #0055AA; +} +div#copyright { + border-top: 1px dotted #003399; + font-size: 6pt; + padding: 10px; + background-image: url(../substages.png); + background-repeat: repeat-x; + width: 70%; + margin: 20px auto 0 auto; + text-align: center; + color: #808080; +} +td.balancer { + width: 21px; + background-image: url(../balancer.png); + background-position: center center; + background-repeat: no-repeat; +} +ul.icons { + margin: 0; + padding: 0; + list-style-type: none; + display: table; +} +ul.icons li:first-child { + border-top-color: #FFFFFF; +} +ul.icons li { + /* Invisible border to prevent size-switching later */ + border: 1px solid #FFFFFF; + border-top-color: #F0F0F0; + margin: 0 0 -2px 0; + padding: 0; + display: block; +} +ul.icons li:hover { + border-color: #D0D0D0; + -moz-border-radius: 5px; +} +a.icon { + display: block; + font-size: 18pt; + line-height: 48px; + padding: 10px 20px 10px 68px; + background-position: 10px center; + background-repeat: no-repeat; + color: #002266; + text-decoration: none !important; +} +a.icon:hover { + cursor: pointer; + color: #002266 !important; + background-color: #F0F0F0; +} +a.icon-disabled { + color: #808080 !important; + opacity: 0.7; + filter: alpha(opacity=70); +} +a.icon-disabled:hover { + color: #808080 !important; + background-color: #FCFCFC; + border-color: #F8F8F8; +} +a.icon small, a.icon-disabled small { + display: block; + font-size: 8pt; + line-height: normal; + margin-top: -10px; +} +a.readme { + background-image: url(../icons/readme.png); +} +a.install { + background-image: url(../icons/install.png); +} +a.install-disabled { + background-image: url(../icons/install-disabled.png); +} +a.upgrade { + background-image: url(../icons/upgrade.png); +} +a.upgrade-disabled { + background-image: url(../icons/upgrade-disabled.png); +} + +.scroller { + padding: 10px; + border: 1px dotted #002266; + background-color: #F0F0F0; + max-height: 500px; + clip: rect(0px, auto, auto, 0px); + overflow: auto; +} + +div#installnotice { + margin: 5% 0 0 0; +} + +table#installmenu { + margin: 0 auto 5% auto; +} +span.fieldtip_js { + display: block; + background-color: #F0F0FF; + padding: 10px; + border: 1px solid #245687; + position: absolute; +} + +/* Inputs, form controls */ + +input[type ^="button"], button { + background-color: #F8F8FB; + color: #202020; + border-color: #B0B0B8 #D0D0D8 #D0D0D8 #B0B0B8; + border-width: 1px; + border-style: solid; +} +input[type ^="submit"] { + background-color: #4F729A; + color: #FFFFFF; + border-width: 1px; + border-style: solid; + border-color: #1F426A #7FA2CA #7FA2CA #1F426A; +} +input[type ^="submit"]:hover, input[type ^="submit"]:focus { + background-color: #5f82aa; +} +input[type ^="text"], input[type ^="password"] { + color: #202020; + background-color: #F0F0F4; + border: 1px solid #D6D6E9; +} +input[type ^="text"]:hover, input[type ^="password"]:hover { + color: #202020; + background-color: #F4F4F8; + border: 1px solid #D6D6E9; +} +input[type ^="text"]:focus, input[type ^="password"]:focus { + color: #202020; + background-color: #FFFFFF; + border: 1px solid #D6D6E9; +} diff -r 299a90e28abc -r 87e08a6e4fec install/images/enano-artwork/README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/install/images/enano-artwork/README Wed Jan 16 13:55:49 2008 -0500 @@ -0,0 +1,8 @@ +The images in this directory are copyright (C) 2007 Dan Fuhry. Except +as permitted by applicable law, they may not be used in any way other +than to promote the unmodified Enano CMS. You also may not modify and +then distribute the images in this directory, or distribute them sep- +arately from the Enano packages. The goal here is to establish a uni- +que identity for Enano through the use of a logo, and that identity +would be confused if this logo is used for unofficial Enano distros. + diff -r 299a90e28abc -r 87e08a6e4fec install/images/enano-artwork/installer-greeting.png Binary file install/images/enano-artwork/installer-greeting.png has changed diff -r 299a90e28abc -r 87e08a6e4fec install/images/enano-artwork/installer-header-blue.png Binary file install/images/enano-artwork/installer-header-blue.png has changed diff -r 299a90e28abc -r 87e08a6e4fec install/images/icons/install-disabled.png Binary file install/images/icons/install-disabled.png has changed diff -r 299a90e28abc -r 87e08a6e4fec install/images/icons/install.png Binary file install/images/icons/install.png has changed diff -r 299a90e28abc -r 87e08a6e4fec install/images/icons/readme.png Binary file install/images/icons/readme.png has changed diff -r 299a90e28abc -r 87e08a6e4fec install/images/icons/src/README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/install/images/icons/src/README Wed Jan 16 13:55:49 2008 -0500 @@ -0,0 +1,3 @@ +These icons are from the Flygo icon set, which is based on icons from the Tango +Desktop Project. They are released under the GNU General Public License. + diff -r 299a90e28abc -r 87e08a6e4fec install/images/icons/src/accessories-text-editor.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/install/images/icons/src/accessories-text-editor.svg Wed Jan 16 13:55:49 2008 -0500 @@ -0,0 +1,916 @@ + + + diff -r 299a90e28abc -r 87e08a6e4fec install/images/icons/src/system-installer.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/install/images/icons/src/system-installer.svg Wed Jan 16 13:55:49 2008 -0500 @@ -0,0 +1,495 @@ + + + diff -r 299a90e28abc -r 87e08a6e4fec install/images/icons/src/system-software-update.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/install/images/icons/src/system-software-update.svg Wed Jan 16 13:55:49 2008 -0500 @@ -0,0 +1,1378 @@ + + + diff -r 299a90e28abc -r 87e08a6e4fec install/images/icons/upgrade-disabled.png Binary file install/images/icons/upgrade-disabled.png has changed diff -r 299a90e28abc -r 87e08a6e4fec install/images/icons/upgrade.png Binary file install/images/icons/upgrade.png has changed diff -r 299a90e28abc -r 87e08a6e4fec install/images/marker.gif Binary file install/images/marker.gif has changed diff -r 299a90e28abc -r 87e08a6e4fec install/images/substages.png Binary file install/images/substages.png has changed diff -r 299a90e28abc -r 87e08a6e4fec install/includes/common.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/install/includes/common.php Wed Jan 16 13:55:49 2008 -0500 @@ -0,0 +1,130 @@ + '1.1.1', + 'type' => 'alpha' + // If type is set to "rc", "beta", or "alpha", optionally another version number can be issued with the key 'sub': + // 'sub' => '3' will produce Enano 1.1.1a3 / Enano 1.1.1 alpha 3 +); + +// Determine Enano root directory + +$enano_root = dirname(dirname(dirname(__FILE__))); +if ( preg_match('#/repo$#', $enano_root) && file_exists("$enano_root/../.enanodev") ) +{ + $enano_root = preg_replace('#/repo$#', '', $enano_root); +} + +define('ENANO_ROOT', $enano_root); + +chdir(ENANO_ROOT); + +// Determine our scriptPath +if ( isset($_SERVER['REQUEST_URI']) ) +{ + // Use reverse-matching to determine where the REQUEST_URI overlaps the Enano root. + $requri = $_SERVER['REQUEST_URI']; + if ( isset($_SERVER['PATH_INFO']) && !preg_match('/index\.php$/', $_SERVER['PATH_INFO']) ) + { + $requri = preg_replace(';' . preg_quote($_SERVER['PATH_INFO']) . '$;', '', $requri); + } + if ( !preg_match('/\.php$/', $requri) ) + { + // user requested http://foo/enano as opposed to http://foo/enano/index.php + $requri .= '/index.php'; + } + $sp = dirname($_SERVER['REQUEST_URI']); + if ( $sp == '/' || $sp == '\\' ) + { + $sp = ''; + } + $sp = preg_replace('#/install$#', '', $sp); + define('scriptPath', $sp); +} + +// is Enano already installed? +@include(ENANO_ROOT . '/config.php'); +if ( defined('ENANO_INSTALLED') && defined('ENANO_DANGEROUS') ) +{ + $title = 'Installation locked'; + require('includes/common.php'); + $template->header(); + echo 'The installer has detected that an installation of Enano already exists on your server. You MUST delete config.php if you wish to reinstall Enano.
'; + $template->footer(); + exit(); +} + +function microtime_float() +{ + list($usec, $sec) = explode(" ", microtime()); + return ((float)$usec + (float)$sec); +} + +define('IN_ENANO_INSTALL', 1); + +require(ENANO_ROOT . '/install/includes/ui.php'); +require(ENANO_ROOT . '/includes/functions.php'); +require(ENANO_ROOT . '/includes/json.php'); +require(ENANO_ROOT . '/includes/constants.php'); +require(ENANO_ROOT . '/includes/rijndael.php'); +// If we have at least PHP 5, load json2 +if ( version_compare(PHP_VERSION, '5.0.0', '>=') ) +{ + require(ENANO_ROOT . '/includes/json2.php'); +} + +// Build a list of available languages +$dir = @opendir( ENANO_ROOT . '/language' ); +if ( !$dir ) + die('CRITICAL: could not open language directory'); + +$languages = array(); +// Use the old PHP4-compatible JSON decoder +$json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE); + +while ( $dh = @readdir($dir) ) +{ + if ( $dh == '.' || $dh == '..' ) + continue; + if ( file_exists( ENANO_ROOT . "/language/$dh/meta.json" ) ) + { + // Found a language directory, determine metadata + $meta = @file_get_contents( ENANO_ROOT . "/language/$dh/meta.json" ); + if ( empty($meta) ) + // Could not read metadata file, continue silently + continue; + $meta = $json->decode($meta); + if ( isset($meta['lang_name_english']) && isset($meta['lang_name_native']) && isset($meta['lang_code']) ) + { + $languages[$meta['lang_code']] = array( + 'name' => $meta['lang_name_native'], + 'dir' => $dh + ); + } + } +} + +if ( count($languages) < 1 ) +{ + die('CRITICAL: No languages are available'); +} + +// List of available DB drivers +$supported_drivers = array('mysql', 'postgresql'); + +?> diff -r 299a90e28abc -r 87e08a6e4fec install/includes/js/formutils.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/install/includes/js/formutils.js Wed Jan 16 13:55:49 2008 -0500 @@ -0,0 +1,169 @@ +/** + * Images used for form field validation + * @var string img_bad: Shown on field validation failure + * @var string img_good: Shown on field validation success + * @var string img_neu: Shown when a field's value matches known good regexp but still needs testing (e.g. DB info) + */ + +var img_bad = '../images/bad.gif'; +var img_good = '../images/good.gif'; +var img_neu = '../images/unknown.gif'; + +/** + * Highlights the background of the next-up$e"; + return false; + } + + $vars = array( + 'TABLE_PREFIX' => $_POST['table_prefix'], + 'SITE_NAME' => $db->escape($_POST['site_name']), + 'SITE_DESC' => $db->escape($_POST['site_desc']), + 'COPYRIGHT' => $db->escape($_POST['copyright']), + // FIXME: update form + 'WIKI_MODE' => ( isset($_POST['wiki_mode']) ? '1' : '0' ), + 'ENABLE_CACHE' => ( is_writable( ENANO_ROOT . '/cache/' ) ? '1' : '0' ), + 'VERSION' => $installer_version['version'], + 'ADMIN_USER' => $db->escape($_POST['username']), + 'ADMIN_PASS' => $admin_pass, + 'ADMIN_EMAIL' => $db->escape($_POST['email']), + 'REAL_NAME' => '', // This has always been stubbed. + 'ADMIN_EMBED_PHP' => strval(AUTH_DISALLOW), + 'UNIX_TIME' => strval(time()) + ); + + $sql_parser->assign_vars($vars); + return $sql_parser->parse(); +} + +function stg_deliver_payload() +{ + global $db; + $schema = stg_load_schema(); + foreach ( $schema as $sql ) + { + if ( !$db->sql_query($sql) ) + { + echo $db->get_error(); + return false; + } + } + return true; +} + diff -r 299a90e28abc -r 87e08a6e4fec install/includes/payloads/mysql.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/install/includes/payloads/mysql.php Wed Jan 16 13:55:49 2008 -0500 @@ -0,0 +1,21 @@ +sql_string = $sql; + } + else + { + if ( file_exists($sql) ) + { + $this->sql_string = @file_get_contents($sql); + if ( empty($this->sql_string) ) + { + throw new Exception('SQL file is blank or permissions are bad'); + } + } + else + { + throw new Exception('SQL file doesn\'t exist'); + } + } + $this->sql_array = false; + $this->tpl_strings = array(); + } + + /** + * Sets template variables. + * @param array Associative array of template variables to assign + */ + + public function assign_vars($vars) + { + if ( !is_array($vars) ) + return false; + $this->tpl_strings = array_merge($this->tpl_strings, $vars); + } + + /** + * Internal function to parse the SQL. + * @access private + */ + + private function parse_sql() + { + $this->sql_array = $this->sql_string; + foreach ( $this->tpl_strings as $key => $value ) + { + $this->sql_array = str_replace("{{{$key}}}", $value, $this->sql_array); + } + + // Build an array of queries + $this->sql_array = explode("\n", $this->sql_array); + + foreach ( $this->sql_array as $i => $sql ) + { + $query =& $this->sql_array[$i]; + $t = trim($query); + if ( empty($t) || preg_match('/^(\#|--)/i', $t) ) + { + unset($this->sql_array[$i]); + unset($query); + } + } + unset($query); + + $this->sql_array = array_values($this->sql_array); + $this->sql_array = implode("\n", $this->sql_array); + $this->sql_array = explode(";\n", $this->sql_array); + + foreach ( $this->sql_array as $i => $sql ) + { + $query =& $this->sql_array[$i]; + if ( substr($query, ( strlen($query) - 1 ), 1 ) != ';' ) + { + $query .= ';'; + } + } + unset($query); + } + + /** + * Returns the parsed array of SQL queries. + * @param bool Optional. Defaults to false. If true, a parse is performed even if it already happened. + * @return array + */ + + public function parse($force_reparse = false) + { + if ( !$this->sql_array || $force_reparse ) + $this->parse_sql(); + return $this->sql_array; + } +} + +?> diff -r 299a90e28abc -r 87e08a6e4fec install/includes/stages/confirm.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/install/includes/stages/confirm.php Wed Jan 16 13:55:49 2008 -0500 @@ -0,0 +1,44 @@ +show_header(); +?> +
Almost there! You've entered all the information we need for now. Click Continue to install the Enano database.
+A note on AES encryption: + Enano is currently configured to use -bit AES encryption. While the default value of 192 bits is perfectly acceptable for most sites, those in need of extreme security will want to change this value to 256 bits (the maximum available strength). If you need to change the cipher strength, please edit the file includes/constants.php and then restart this installation. Do not click Continue below until you redo the installation process up until this point, or you will experience severe problems with logging into your site. +
+ diff -r 299a90e28abc -r 87e08a6e4fec install/includes/stages/database.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/install/includes/stages/database.php Wed Jan 16 13:55:49 2008 -0500 @@ -0,0 +1,110 @@ +' . $lang->get('database_driver_heading') . ''; +echo '' . $lang->get('database_driver_intro') . '
'; +if ( @file_exists('/etc/enano-is-virt-appliance') ) +{ + echo '' . $lang->get('database_driver_msg_virt_appliance') . '
'; +} + +$mysql_disable_reason = ''; +$pgsql_disable_reason = ''; +$mysql_disable = ''; +$pgsql_disable = ''; +if ( !function_exists('mysql_connect') ) +{ + $mysql_disable = ' disabled="disabled"'; + $mysql_disable_reason = $lang->get('database_driver_err_no_mysql'); +} +if ( !function_exists('pg_connect') ) +{ + $pgsql_disable = ' disabled="disabled"'; + $pgsql_disable_reason = $lang->get('database_driver_err_no_pgsql'); +} + +echo ''; diff -r 299a90e28abc -r 87e08a6e4fec install/includes/stages/database_mysql.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/install/includes/stages/database_mysql.php Wed Jan 16 13:55:49 2008 -0500 @@ -0,0 +1,508 @@ + false, + 'host_good' => true, + 'creating_user' => false, + 'db_exist' => false, + 'creating_db' => false, + 'creating_db_grant' => false, + 'root_fail' => false, + 'version' => array( + 'version' => 'unknown', + 'good' => 'indeterminate' + ), + 'last_error' => '' + ); + + if ( !isset($_POST['info']) ) + die(); + + $info = $_POST['info']; + + // From here on out will be JSON responses + header('Content-type: application/json'); + + try + { + $info = @enano_json_decode($info); + } + catch ( Zend_Json_Exception $e ) + { + die(enano_json_encode(array( + 'mode' => 'error', + 'error' => 'Exception in JSON decoder' + ))); + } + + // Try to connect as the normal user + $test = @mysql_connect($info['db_host'], $info['db_user'], $info['db_pass']); + if ( !$test ) + { + $return['creating_user'] = true; + $return['last_error'] = mysql_error(); + if ( strstr( $return['last_error'], 'Lost connection' ) || strstr( $return['last_error'], 'Unknown MySQL server host' ) ) + { + $return['host_good'] = false; + } + // Doing that failed. If we have root credentials, test those + if ( !empty($info['db_root_user']) && !empty($info['db_root_pass']) ) + { + // Log in with root rights and if that works, tell 'em we'll reset the password or create + // the account if it doesn't exist already. This is done with GRANT ALL PRIVILEGES ON enano_db.* + // etc etc, a little hackish but known to work with MySQL >= 4.1. + $test_root = @mysql_connect($info['db_host'], $info['db_root_user'], $info['db_root_pass']); + if ( $test_root ) + { + // We logged in with root rights, assume that we have appropriate permissions. + // If not, well, the installation will fail. Tough on the user, but creating + // test databases/users is too risky. + + // Does the database exist? + $q = @mysql_query('USE `' . mysql_real_escape_string($info['db_name']) . '`;', $test_root); + if ( !$q ) + { + // Nope, we'll have to create it + $return['creating_db'] = true; + $return['last_error'] = mysql_error(); + } + + $version = mysql_get_server_info($test_root); + $return['version'] = array( + 'version' => $version, + 'good' => version_compare($version, '4.0.17', '>=') + ); + + $return['can_install'] = ( $return['version']['good'] ) ? true : false; + } + else + { + // Well that helped. Root credentials are bad. + $return['creating_db'] = true; + $return['root_fail'] = true; + } + } + else + { + // No root credentials, fail out + $return['root_fail'] = true; + } + } + else + { + // We're connected; do we have permission to use the database? + $have_database = false; + $q = @mysql_query('USE `' . mysql_real_escape_string($info['db_name']) . '`;', $test); + if ( $q ) + { + // Permissions are good and we're all connected. Perform version check... + $version = mysql_get_server_info($test); + $return['version'] = array( + 'version' => $version, + 'good' => version_compare($version, '4.0.17', '>=') + ); + + $return['can_install'] = ( $return['version']['good'] ) ? true : false; + } + else + { + $return['last_error'] = mysql_error(); + $return['creating_db'] = true; + + // We don't have permission to use the database or it doesn't exist. + // See if we have a root login to work with, if not then fail + if ( !empty($info['db_root_user']) && !empty($info['db_root_pass']) ) + { + // Log in with root rights and if that works, tell 'em we'll create the database. + $test_root = @mysql_connect($info['db_host'], $info['db_root_user'], $info['db_root_pass']); + if ( $test_root ) + { + // We logged in with root rights, assume that we have appropriate permissions. + // If not, well, the installation will fail. Tough on the user, but creating + // test databases/users is too risky. + + // See if the database already exists + $dbname = mysql_real_escape_string($info['db_name']); + $q = @mysql_query("SHOW DATABASES LIKE '$dbname';", $test_root); + if ( $q ) + { + if ( mysql_num_rows($q) > 0 ) + { + $return['creating_db'] = false; + $return['creating_db_grant'] = true; + } + @mysql_free_result($q); + } + + $version = mysql_get_server_info($test); + $return['version'] = array( + 'version' => $version, + 'good' => version_compare($version, '4.0.17', '>=') + ); + + $return['can_install'] = ( $return['version']['good'] ) ? true : false; + } + else + { + // Well that helped. Root credentials are bad. + $return['creating_db'] = true; + $return['root_fail'] = true; + } + } + // No root credentials, fail out + } + } + + if ( isset($test) && @is_resource($test) ) + @mysql_close($test); + + if ( isset($test_root) && @is_resource($test_root) ) + @mysql_close($test_root); + + echo enano_json_encode($return); + + exit(); +} + +$ui->add_header(''); +$ui->show_header(); + +?> + +get('dbmysql_blurb_needdb'); ?>
+get('dbmysql_blurb_howtomysql'); ?>
+ + ' . $lang->get('database_vm_login_info', array( 'host' => 'localhost', 'user' => 'enano', 'pass' => 'clurichaun', 'name' => 'enano_www1' )) . ' + '; +} +?> + + + + + + + diff -r 299a90e28abc -r 87e08a6e4fec install/includes/stages/database_post.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/install/includes/stages/database_post.php Wed Jan 16 13:55:49 2008 -0500 @@ -0,0 +1,168 @@ +connect(true, $db_host, $db_user, $db_pass, $db_name); + +$ui->show_header(); + +if ( $result ) +{ + // We're good, write out a config file + $ch = @fopen( ENANO_ROOT . '/config.new.php', 'w' ); + if ( !$ch ) + { + ?> + + That table prefix isn\'t going to work.'; + return true; + } + fwrite($ch, " +The SQL schema file couldn't be loaded.
+ $e"; ?> + sql_query('SELECT config_name, config_value FROM ' . $db_prefix . 'config LIMIT 1;'); + if ( !$q ) + { + $sql_parser->assign_vars(array( + 'TABLE_PREFIX' => $db_prefix + )); + $sql = $sql_parser->parse(); + foreach ( $sql as $q ) + { + if ( !$dbal->sql_query($q) ) + { + ?> + + free_result(); + if ( !$dbal->sql_query('DELETE FROM ' . $db_prefix . 'config WHERE config_name = \'install_aes_key\';') ) + { + $dbal->_die('install database_post.php trying to remove old AES installer key'); + } + } + $dbal->close(); + ?> + + + + + false, + 'host_good' => true, + 'creating_user' => false, + 'db_exist' => false, + 'creating_db' => false, + 'creating_db_grant' => false, + 'root_fail' => false, + 'version' => array( + 'version' => 'unknown', + 'good' => 'indeterminate' + ), + 'last_error' => '' + ); + + if ( !isset($_POST['info']) ) + die(); + + $info = $_POST['info']; + + // From here on out will be JSON responses + header('Content-type: application/json'); + + try + { + $info = @enano_json_decode($info); + } + catch ( Zend_Json_Exception $e ) + { + die(enano_json_encode(array( + 'mode' => 'error', + 'error' => 'Exception in JSON decoder' + ))); + } + + // Try to connect as the normal user + // generate connection string + $conn_string = "dbname = '" . addslashes($info['db_name']) . "' port = '5432' host = '" . addslashes($info['db_host']) . "' " . + "user= '" . addslashes($info['db_user']) . "' password = '" . addslashes($info['db_pass']) . "'"; + $test = @pg_connect($conn_string); + if ( !$test ) + { + // Connection as normal user failed. PgSQL doesn't give us an error string so + // just try to connect as root. If even that fails, exit with an error + $return['creating_user'] = true; + if ( !empty($info['db_root_user']) && !empty($info['db_root_pass']) ) + { + $conn_string_root = "dbname = '" . addslashes($info['db_name']) . "' port = '5432' host = '" . addslashes($info['db_host']) . "' " . + "user= '" . addslashes($info['db_root_user']) . "' password = '" . addslashes($info['db_root_pass']) . "'"; + // Attempt connection as root + $test_root = @pg_connect($conn_string_root); + if ( !$test_root ) + { + $return['root_fail'] = true; + } + else + { + $return['can_install'] = true; + } + } + } + else + { + $return['can_install'] = true; + } + + $did_version_check = false; + + if ( isset($test) && @is_resource($test) ) + { + $server_info = @pg_version($test); + if ( isset($server_info['server']) ) + { + $did_version_check = true; + $return['version'] = array( + 'version' => $server_info['server'], + 'good' => ( version_compare($server_info['server'], '8.2.5', '>=') ) + ); + } + @pg_close($test); + } + + if ( isset($test_root) && @is_resource($test_root) ) + { + $server_info = @pg_version($test_root); + if ( isset($server_info['server']) ) + { + $did_version_check = true; + $return['version'] = array( + 'version' => $server_info['server'], + 'good' => ( version_compare($server_info['server'], '8.2.5', '>=') ) + ); + } + @pg_close($test_root); + } + + if ( !$did_version_check ) + { + $return['version'] = array( + 'version' => 'indeterminate', + 'good' => false + ); + } + else + { + if ( !$return['version']['good'] ) + { + $return['can_install'] = false; + } + } + + echo enano_json_encode($return); + + exit(); +} + +$ui->add_header(''); +$ui->show_header(); + +?> + + + + + + + diff -r 299a90e28abc -r 87e08a6e4fec install/includes/stages/install.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/install/includes/stages/install.php Wed Jan 16 13:55:49 2008 -0500 @@ -0,0 +1,97 @@ +show_header(); + echo 'ERROR: That database driver is not supported.
'; + return true; +} + +$db = new $dbdriver(); +$result = $db->connect(true, $dbhost, $dbuser, $dbpasswd, $dbname); +if ( !$result ) +{ + $ui->show_header(); + // FIXME: l10n + ?> + + show_header(); +flush(); + +?> +Please wait while Enano creates its database and initial content on your server.
+ +get('license_info_unstable_body'); ?>
+ +get('license_gpl_blurb_inenglish'); ?>
+ + + Because I could never find the Create a Page button in PHP-Nuke.'; + echo '' . str_replace('http://enanocms.org/', 'http://www.2robots.com/2003/10/15/web-portals-suck/', $template->fading_button) . '
'; + echo 'It\'s not a portal, my friends.
'; + } + ?> +([\s]*?)<\/p>#is', '', $result);
+ $result = preg_replace('#
([\s]*?)
$desc | "; + } elseif(!$val && $warn) { + if($cv) $color='FFFFCC'; else $color='FFFFAA'; + echo " |
$desc $extended_desc | |
$desc $extended_desc |
Didn't expect to see this message? + It's possible that your configuration file has become corrupted and no longer sets information that Enano needs to connect + to the database. You should have a look at your config.php by downloading it with FTP or viewing it over SSH. + If the file appears to have been tampered with, please contact the Enano team + for support immediately.
+Most importantly, if you suspect a security breach, you should contact the Enano team + via e-mail. If you have the capability to use PGP encryption, you should do + so; our public key is available here.
++ + + | ++ | +
+
|
+
+ PHP 5 is the latest version of the language on which Enano was built. Its many new features have been available since early 2004, yet + many web hosts have not migrated to it because of the work involved. In 2007, Zend Corporation announced that support for the aging + PHP 4.x would be discontinued at the end of the year. An initiative called GoPHP5 was started to + encourage web hosts to migrate to PHP 5. +
++ Because of the industry's decision to not support PHP 4 any longer, the Enano team decided that it was time to begin using the powerful + features of PHP 5 at the expense of PHP 4 compatibility. Therefore, this version of Enano cannot be installed on your server until it + is upgraded to at least PHP 5.0.0, and preferably the latest available version. + +
++ If you need to use Enano but can't upgrade your PHP because you're on a shared or reseller hosting service, you can use the + 1.0.x series of Enano on your site. While the Enano team attempts to make this + older series work on PHP 4, official support is not provided for installations of Enano on PHP 4. +
+ show_footer(); + exit(); +} + +if ( isset($_SERVER['PATH_INFO']) && !isset($_GET['str']) && isset($_GET['do']) ) +{ + $_GET['str'] = substr($_SERVER['PATH_INFO'], 1); +} + +if ( isset($_GET['do']) ) +{ + switch ( $_GET['do'] ) + { + case 'lang_js': + if ( !isset($_GET['language']) ) + die(); + $lang_id = $_GET['language']; + header('Content-type: text/javascript'); + if ( !isset($languages[$lang_id]) ) + { + die('// Bad language ID'); + } + $language_dir = $languages[$lang_id]['dir']; + + // Include language lib and additional PHP5-only JSON functions + require_once( ENANO_ROOT . '/includes/json2.php' ); + require_once( ENANO_ROOT . '/includes/lang.php' ); + + // Initialize language support + $lang = new Language($lang_id); + $lang->load_file(ENANO_ROOT . '/language/' . $language_dir . '/install.json'); + $lang->load_file(ENANO_ROOT . '/language/' . $language_dir . '/core.json'); + + $time_now = microtime_float(); + $test = "if ( typeof(enano_lang) != 'object' ) +{ + var enano_lang = new Object(); + var enano_lang_code = new Object(); +} + +enano_lang[{$lang->lang_id}] = " . enano_json_encode($lang->strings) . "; +enano_lang_code[{$lang->lang_id}] = '{$lang->lang_code}';"; + $time_total = round(microtime_float() - $time_now, 4); + echo "// Generated in $time_total seconds\n"; + echo $test; + + exit(); + case 'modrewrite_test': + // Include language lib and additional PHP5-only JSON functions + require_once( ENANO_ROOT . '/includes/json2.php' ); + + if ( isset($_GET['str']) && in_array($_GET['str'], array('standard', 'shortened', 'rewrite')) ) + { + echo 'good_' . $_GET['str']; + } + else + { + echo 'bad'; + } + exit(); + } +} + +switch ( $stage ) +{ + default: + $ui->show_header(); + echo 'Invalid stage.
'; + break; + case 'language': + $ui->show_header(); + ?> ++ Please select a language: / + Por favor, seleccione un idioma: / + Bitte wählen Sie eine Sprache: / + S’il vous plaît choisir une langue: / + Selezionare una lingua: / + 请选择一种语言: / + 言語を選択してください:
+ + show_header(); + require( ENANO_ROOT . '/includes/wikiformat.php' ); + require( ENANO_ROOT . '/install/includes/stages/license.php' ); + break; + case 'sysreqs': + $ui->show_header(); + require( ENANO_ROOT . '/install/includes/stages/sysreqs.php' ); + break; + case 'database': + if ( isset($_POST['driver']) && in_array($_POST['driver'], $supported_drivers) ) + { + // This is SAFE! It's validated against the array in in_array() above. + $driver = $_POST['driver']; + require( ENANO_ROOT . "/install/includes/stages/database_{$driver}.php" ); + } + else + { + $ui->show_header(); + // No driver selected - give the DB drive selection page + require( ENANO_ROOT . '/install/includes/stages/database.php' ); + } + break; + case 'website': + require( ENANO_ROOT . '/install/includes/stages/website.php' ); + break; + case 'login': + require( ENANO_ROOT . '/install/includes/stages/login.php' ); + break; + case 'confirm': + require( ENANO_ROOT . '/install/includes/stages/confirm.php' ); + break; + case 'install': + require( ENANO_ROOT . '/install/includes/stages/install.php' ); + break; +} + +$ui->show_footer(); + +?> diff -r 299a90e28abc -r 87e08a6e4fec install/readme.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/install/readme.php Wed Jan 16 13:55:49 2008 -0500 @@ -0,0 +1,41 @@ +add_stage('Readme and important information', true); + +$ui->set_visible_stage($stg_readme); + +$ui->show_header(); + +?> +This document contains important information you'll want to know before you install Enano. For installation instructions, please + see the Enano installation guide. Return to welcome menu »
+ +show_footer(); + +?> diff -r 299a90e28abc -r 87e08a6e4fec install/schemas/mysql_stage1.sql --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/install/schemas/mysql_stage1.sql Wed Jan 16 13:55:49 2008 -0500 @@ -0,0 +1,17 @@ +-- Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between +-- Version 1.0.2 (Coblynau) +-- 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. + +-- mysql_stage1.sql - MySQL installation schema, early stage + +CREATE TABLE {{TABLE_PREFIX}}config( + config_name varchar(63), + config_value text +) CHARACTER SET `utf8` COLLATE `utf8_bin`; + diff -r 299a90e28abc -r 87e08a6e4fec install/schemas/mysql_stage2.sql --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/install/schemas/mysql_stage2.sql Wed Jan 16 13:55:49 2008 -0500 @@ -0,0 +1,343 @@ +-- Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between +-- Version 1.0.2 (Coblynau) +-- 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. + +-- mysql_stage2.sql - MySQL installation schema, main payload + +CREATE TABLE {{TABLE_PREFIX}}categories( + page_id varchar(64), + namespace varchar(64), + category_id varchar(64) +) CHARACTER SET `utf8` COLLATE `utf8_bin`; + +CREATE TABLE {{TABLE_PREFIX}}comments( + comment_id int(12) NOT NULL auto_increment, + page_id text, + namespace text, + subject text, + comment_data text, + name text, + approved tinyint(1) default 1, + user_id mediumint(8) NOT NULL DEFAULT -1, + time int(12) NOT NULL DEFAULT 0, + PRIMARY KEY ( comment_id ) +) CHARACTER SET `utf8` COLLATE `utf8_bin`; + +CREATE TABLE {{TABLE_PREFIX}}logs( + log_type varchar(16), + action varchar(16), + time_id int(12) NOT NULL default '0', + date_string varchar(63), + page_id text, + namespace text, + page_text text, + char_tag varchar(40), + author varchar(63), + edit_summary text, + minor_edit tinyint(1) +) CHARACTER SET `utf8` COLLATE `utf8_bin`; + +CREATE TABLE {{TABLE_PREFIX}}page_text( + page_id varchar(255), + namespace varchar(16) NOT NULL default 'Article', + page_text text, + char_tag varchar(63), + FULLTEXT KEY {{TABLE_PREFIX}}page_search_idx (page_id, namespace, page_text) +) ENGINE = MYISAM CHARACTER SET `utf8`; + +CREATE TABLE {{TABLE_PREFIX}}pages( + page_order int(8), + name varchar(255), + urlname varchar(255), + namespace varchar(16) NOT NULL default 'Article', + special tinyint(1) default '0', + visible tinyint(1) default '1', + comments_on tinyint(1) default '1', + protected tinyint(1) NOT NULL DEFAULT 0, + wiki_mode tinyint(1) NOT NULL DEFAULT 2, + delvotes int(10) NOT NULL default 0, + password varchar(40) NOT NULL DEFAULT '', + delvote_ips text DEFAULT NULL +) CHARACTER SET `utf8` COLLATE `utf8_bin`; + +CREATE TABLE {{TABLE_PREFIX}}session_keys( + session_key varchar(32), + salt varchar(32), + user_id mediumint(8), + auth_level tinyint(1) NOT NULL default '0', + source_ip varchar(10) default '0x7f000001', + time bigint(15) default '0' +) CHARACTER SET `utf8` COLLATE `utf8_bin`; + +CREATE TABLE {{TABLE_PREFIX}}themes( + theme_id varchar(63), + theme_name text, + theme_order smallint(5) NOT NULL default '1', + default_style varchar(63) NOT NULL DEFAULT '', + enabled tinyint(1) NOT NULL default '1' +) CHARACTER SET `utf8` COLLATE `utf8_bin`; + +CREATE TABLE {{TABLE_PREFIX}}users( + user_id mediumint(8) NOT NULL auto_increment, + username text, + password varchar(255), + email text, + real_name text, + user_level tinyint(1) NOT NULL default 2, + theme varchar(64) NOT NULL default 'bleu.css', + style varchar(64) NOT NULL default 'default', + signature text, + reg_time int(11) NOT NULL DEFAULT 0, + account_active tinyint(1) NOT NULL DEFAULT 0, + activation_key varchar(40) NOT NULL DEFAULT 0, + old_encryption tinyint(1) NOT NULL DEFAULT 0, + temp_password text, + temp_password_time int(12) NOT NULL DEFAULT 0, + user_coppa tinyint(1) NOT NULL DEFAULT 0, + user_lang smallint(5) NOT NULL, + user_has_avatar tinyint(1) NOT NULL, + avatar_type ENUM('jpg', 'png', 'gif') NOT NULL, + PRIMARY KEY (user_id) +) CHARACTER SET `utf8` COLLATE `utf8_bin`; + +CREATE TABLE {{TABLE_PREFIX}}users_extra( + user_id mediumint(8) NOT NULL, + user_aim varchar(63), + user_yahoo varchar(63), + user_msn varchar(255), + user_xmpp varchar(255), + user_homepage text, + user_location text, + user_job text, + user_hobbies text, + email_public tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY ( user_id ) +) CHARACTER SET `utf8` COLLATE `utf8_bin`; + +CREATE TABLE {{TABLE_PREFIX}}banlist( + ban_id mediumint(8) NOT NULL auto_increment, + ban_type tinyint(1), + ban_value varchar(64), + is_regex tinyint(1) DEFAULT 0, + reason text, + PRIMARY KEY ( ban_id ) +) CHARACTER SET `utf8` COLLATE `utf8_bin`; + +CREATE TABLE {{TABLE_PREFIX}}files( + file_id int(12) NOT NULL auto_increment, + time_id int(12) NOT NULL, + page_id varchar(63) NOT NULL, + filename varchar(127) default NULL, + size bigint(15) NOT NULL, + mimetype varchar(63) default NULL, + file_extension varchar(8) default NULL, + file_key varchar(32) NOT NULL, + PRIMARY KEY (file_id) +) CHARACTER SET `utf8` COLLATE `utf8_bin`; + +CREATE TABLE {{TABLE_PREFIX}}buddies( + buddy_id int(15) NOT NULL auto_increment, + user_id mediumint(8), + buddy_user_id mediumint(8), + is_friend tinyint(1) NOT NULL default '1', + PRIMARY KEY (buddy_id) +) CHARACTER SET `utf8` COLLATE `utf8_bin`; + +CREATE TABLE {{TABLE_PREFIX}}privmsgs( + message_id int(15) NOT NULL auto_increment, + message_from varchar(63), + message_to varchar(255), + date int(12), + subject varchar(63), + message_text text, + folder_name varchar(63), + message_read tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY (message_id) +) CHARACTER SET `utf8` COLLATE `utf8_bin`; + +CREATE TABLE {{TABLE_PREFIX}}sidebar( + item_id smallint(3) NOT NULL auto_increment, + item_order smallint(3) NOT NULL DEFAULT 0, + item_enabled tinyint(1) NOT NULL DEFAULT 1, + sidebar_id smallint(3) NOT NULL DEFAULT 1, + block_name varchar(63) NOT NULL, + block_type tinyint(1) NOT NULL DEFAULT 0, + block_content text, + PRIMARY KEY ( item_id ) +) CHARACTER SET `utf8` COLLATE `utf8_bin`; + +CREATE TABLE {{TABLE_PREFIX}}hits( + hit_id bigint(20) NOT NULL auto_increment, + username varchar(63) NOT NULL, + time int(12) NOT NULL DEFAULT 0, + page_id varchar(63), + namespace varchar(63), + PRIMARY KEY ( hit_id ) +) CHARACTER SET `utf8` COLLATE `utf8_bin`; + +CREATE TABLE {{TABLE_PREFIX}}search_index( + word varchar(64) NOT NULL, + page_names text, + PRIMARY KEY ( word ) +) CHARACTER SET `utf8` COLLATE `utf8_bin`; + +CREATE TABLE {{TABLE_PREFIX}}groups( + group_id mediumint(5) UNSIGNED NOT NULL auto_increment, + group_name varchar(64), + group_type tinyint(1) NOT NULL DEFAULT 1, + PRIMARY KEY ( group_id ), + system_group tinyint(1) NOT NULL DEFAULT 0 +) CHARACTER SET `utf8` COLLATE `utf8_bin`; + +CREATE TABLE {{TABLE_PREFIX}}group_members( + member_id int(12) UNSIGNED NOT NULL auto_increment, + group_id mediumint(5) UNSIGNED NOT NULL, + user_id int(12) NOT NULL, + is_mod tinyint(1) NOT NULL DEFAULT 0, + pending tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY ( member_id ) +) CHARACTER SET `utf8` COLLATE `utf8_bin`; + +CREATE TABLE {{TABLE_PREFIX}}acl( + rule_id int(12) UNSIGNED NOT NULL auto_increment, + target_type tinyint(1) UNSIGNED NOT NULL, + target_id int(12) UNSIGNED NOT NULL, + page_id varchar(255), + namespace varchar(24), + rules text, + PRIMARY KEY ( rule_id ) +) CHARACTER SET `utf8` COLLATE `utf8_bin`; + +-- Added in 1.0.1 + +CREATE TABLE {{TABLE_PREFIX}}page_groups( + pg_id mediumint(8) NOT NULL auto_increment, + pg_type tinyint(2) NOT NULL DEFAULT 1, + pg_name varchar(255) NOT NULL DEFAULT '', + pg_target varchar(255) DEFAULT NULL, + PRIMARY KEY ( pg_id ) +) CHARACTER SET `utf8` COLLATE `utf8_bin`; + +-- Added in 1.0.1 + +CREATE TABLE {{TABLE_PREFIX}}page_group_members( + pg_member_id int(12) NOT NULL auto_increment, + pg_id mediumint(8) NOT NULL, + page_id varchar(63) NOT NULL, + namespace varchar(63) NOT NULL DEFAULT 'Article', + PRIMARY KEY ( pg_member_id ) +) CHARACTER SET `utf8` COLLATE `utf8_bin`; + +-- Added in 1.0.1 + +CREATE TABLE {{TABLE_PREFIX}}tags( + tag_id int(12) NOT NULL auto_increment, + tag_name varchar(63) NOT NULL DEFAULT 'bla', + page_id varchar(255) NOT NULL, + namespace varchar(255) NOT NULL, + user mediumint(8) NOT NULL DEFAULT 1, + PRIMARY KEY ( tag_id ) +) CHARACTER SET `utf8` COLLATE `utf8_bin`; + +-- Added in 1.1.1 + +CREATE TABLE {{TABLE_PREFIX}}lockout( + id int(12) NOT NULL auto_increment, + ipaddr varchar(40) NOT NULL, + action ENUM('credential', 'level') NOT NULL DEFAULT 'credential', + timestamp int(12) NOT NULL DEFAULT 0, + PRIMARY KEY ( id ) +) CHARACTER SET `utf8`; + +-- Added in 1.1.1 + +CREATE TABLE {{TABLE_PREFIX}}language( + lang_id smallint(5) NOT NULL auto_increment, + lang_code varchar(16) NOT NULL, + lang_name_default varchar(64) NOT NULL, + lang_name_native varchar(64) NOT NULL, + last_changed int(12) NOT NULL DEFAULT 0, + PRIMARY KEY ( lang_id ) +) CHARACTER SET `utf8`; + +-- Added in 1.1.1 + +CREATE TABLE {{TABLE_PREFIX}}language_strings( + string_id bigint(15) NOT NULL auto_increment, + lang_id smallint(5) NOT NULL, + string_category varchar(32) NOT NULL, + string_name varchar(64) NOT NULL, + string_content longtext NOT NULL, + PRIMARY KEY ( string_id ) +); + +DELETE FROM {{TABLE_PREFIX}}config; + +INSERT INTO {{TABLE_PREFIX}}config(config_name, config_value) VALUES + ('site_name', '{{SITE_NAME}}'), + ('main_page', 'Main_Page'), + ('site_desc', '{{SITE_DESC}}'), + ('wiki_mode', '{{WIKI_MODE}}'), + ('wiki_edit_notice', '0'), + ('sflogo_enabled', '0'), + ('sflogo_groupid', ''), + ('sflogo_type', '1'), + ('w3c_vh32', '0'), + ('w3c_vh40', '0'), + ('w3c_vh401', '0'), + ('w3c_vxhtml10', '0'), + ('w3c_vxhtml11', '0'), + ('w3c_vcss', '0'), + ('approve_comments', '0'), + ('enable_comments', '1'), + ('plugin_SpecialAdmin.php', '1'), + ('plugin_SpecialPageFuncs.php', '1'), + ('plugin_SpecialUserFuncs.php', '1'), + ('plugin_SpecialCSS.php', '1'), + ('copyright_notice', '{{COPYRIGHT}}'), + ('wiki_edit_notice_text', '== Why can I edit this page? ==\n\nEveryone can edit almost any page in this website. This concept is called a wiki. It gives everyone the opportunity to make a change for the best. While some spam and vandalism may occur, it is believed that most contributions will be legitimate and helpful.\n\nFor security purposes, a history of all page edits is kept, and administrators are able to restore vandalized or spammed pages with just a few clicks.'), + ('cache_thumbs', '{{ENABLE_CACHE}}'), + ('max_file_size', '256000'),('enano_version', '{{VERSION}}'),( 'allowed_mime_types', 'cbf:len=185;crc=55fb6f14;data=0[1],1[4],0[3],1[1],0[22],1[1],0[16],1[3],0[16],1[1],0[1],1[2],0[6],1[1],0[1],1[1],0[4],1[2],0[3],1[1],0[48],1[2],0[2],1[1],0[4],1[1],0[37]|end' ), + ('contact_email', '{{ADMIN_EMAIL}}'), + ('powered_btn', '1'); + +INSERT INTO {{TABLE_PREFIX}}page_text(page_id, namespace, page_text, char_tag) VALUES + ('Main_Page', 'Article', '=== Enano has been successfully installed and is working. ===\n\nIf you can see this message, it means that you\'ve finished the Enano setup process and are ready to start building your website. Congratulations!\n\nTo edit this front page, click the Log In button to the left, enter the credentials you provided during the installation, and click the Edit This Page button that appears on the blue toolbar just above this text. You can also [http://docs.enanocms.org/Help:2.4 learn more] about editing pages.\n\nTo create more pages, use the Create a Page button to the left. If you enabled wiki mode, you don\'t have to log in first, however your IP address will be shown in the page history.\n\nVisit the [http://docs.enanocms.org/Help:Contents Enano documentation project website] to learn more about administering your site effectively and keeping things secure.\n\n\'\'\'NOTE:\'\'\' You have just installed an unstable version of Enano. This release is completely unsupported and may contain security issues or serious usability bugs. You should not use this release on a production website. The Enano team will not provide any type of support at all for this experimental release.', ''); + +INSERT INTO {{TABLE_PREFIX}}pages(page_order, name, urlname, namespace, special, visible, comments_on, protected, delvotes, delvote_ips) VALUES + (NULL, 'Main Page', 'Main_Page', 'Article', 0, 1, 1, 1, 0, ''); + +INSERT INTO {{TABLE_PREFIX}}themes(theme_id, theme_name, theme_order, default_style, enabled) VALUES + ('oxygen', 'Oxygen', 1, 'bleu.css', 1), + ('stpatty', 'St. Patty', 2, 'shamrock.css', 1); + +INSERT INTO {{TABLE_PREFIX}}users(user_id, username, password, email, real_name, user_level, theme, style, signature, reg_time, account_active) VALUES + (1, 'Anonymous', 'invalid-pass-hash', 'anonspam@enanocms.org', 'None', 1, 'oxygen', 'bleu', '', 0, 0), + (2, '{{ADMIN_USER}}', '{{ADMIN_PASS}}', '{{ADMIN_EMAIL}}', '{{REAL_NAME}}', 9, 'oxygen', 'bleu', '', UNIX_TIMESTAMP(), 1); + +INSERT INTO {{TABLE_PREFIX}}users_extra(user_id) VALUES + (2); + +INSERT INTO {{TABLE_PREFIX}}groups(group_id,group_name,group_type,system_group) VALUES(1, 'Everyone', 3, 1), + (2,'Administrators',3,1), + (3,'Moderators',3,1); + +INSERT INTO {{TABLE_PREFIX}}group_members(group_id,user_id,is_mod) VALUES(2, 2, 1); + +INSERT INTO {{TABLE_PREFIX}}acl(target_type,target_id,page_id,namespace,rules) VALUES + (1,2,NULL,NULL,'read=4;post_comments=4;edit_comments=4;edit_page=4;view_source=4;mod_comments=4;history_view=4;history_rollback=4;history_rollback_extra=4;protect=4;rename=4;clear_logs=4;vote_delete=4;vote_reset=4;delete_page=4;tag_create=4;tag_delete_own=4;tag_delete_other=4;set_wiki_mode=4;password_set=4;password_reset=4;mod_misc=4;edit_cat=4;even_when_protected=4;upload_files=4;upload_new_version=4;create_page=4;php_in_pages={{ADMIN_EMBED_PHP}};edit_acl=4;'), + (1,3,NULL,NULL,'read=4;post_comments=4;edit_comments=4;edit_page=4;view_source=4;mod_comments=4;history_view=4;history_rollback=4;history_rollback_extra=4;protect=4;rename=3;clear_logs=2;vote_delete=4;vote_reset=4;delete_page=4;set_wiki_mode=2;password_set=2;password_reset=2;mod_misc=2;edit_cat=4;even_when_protected=4;upload_files=2;upload_new_version=3;create_page=3;php_in_pages=2;edit_acl=2;'); + +INSERT INTO {{TABLE_PREFIX}}sidebar(item_id, item_order, sidebar_id, block_name, block_type, block_content) VALUES + (1, 1, 1, '{lang:sidebar_title_navigation}', 1, '[[Main_Page|{lang:sidebar_btn_home}]]'), + (2, 2, 1, '{lang:sidebar_title_tools}', 1, '[[$NS_SPECIAL$CreatePage|{lang:sidebar_btn_createpage}]]\n[[$NS_SPECIAL$UploadFile|{lang:sidebar_btn_uploadfile}]]\n[[$NS_SPECIAL$SpecialPages|{lang:sidebar_btn_specialpages}]]\n{if auth_admin}\n$ADMIN_LINK$\n[[$NS_SPECIAL$EditSidebar|{lang:sidebar_btn_editsidebar}]]\n{/if}'), + (3, 3, 1, '$USERNAME$', 1, '[[$NS_USER$$USERNAME$|{lang:sidebar_btn_userpage}]]\n[[$NS_SPECIAL$Contributions/$USERNAME$|{lang:sidebar_btn_mycontribs}]]\n{if user_logged_in}\n[[$NS_SPECIAL$Preferences|{lang:sidebar_btn_preferences}]]\n[[$NS_SPECIAL$PrivateMessages|{lang:sidebar_btn_privatemessages}]]\n[[$NS_SPECIAL$Usergroups|{lang:sidebar_btn_groupcp}]]\n$THEME_LINK$\n{/if}\n{if user_logged_in}\n$LOGOUT_LINK$\n{else}\n[[$NS_SPECIAL$Register|{lang:sidebar_btn_register}]]\n$LOGIN_LINK$\n[[$NS_SPECIAL$Login/$NS_SPECIAL$PrivateMessages|{lang:sidebar_btn_privatemessages}]]\n{/if}'), + (4, 4, 1, '{lang:sidebar_title_search}', 1, ''), + (5, 2, 2, '{lang:sidebar_title_links}', 4, 'Links'); + diff -r 299a90e28abc -r 87e08a6e4fec install/schemas/postgresql_stage1.sql --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/install/schemas/postgresql_stage1.sql Wed Jan 16 13:55:49 2008 -0500 @@ -0,0 +1,17 @@ +-- Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between +-- Version 1.0.2 (Coblynau) +-- 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. + +-- mysql_stage1.sql - MySQL installation schema, early stage + +CREATE TABLE {{TABLE_PREFIX}}config( + config_name varchar(63), + config_value text +); + diff -r 299a90e28abc -r 87e08a6e4fec install/schemas/postgresql_stage2.sql --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/install/schemas/postgresql_stage2.sql Wed Jan 16 13:55:49 2008 -0500 @@ -0,0 +1,337 @@ +-- Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between +-- Version 1.0.2 (Coblynau) +-- 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. + +-- mysql_stage2.sql - MySQL installation schema, main payload + +CREATE TABLE {{TABLE_PREFIX}}categories( + page_id varchar(64), + namespace varchar(64), + category_id varchar(64) +); + +CREATE TABLE {{TABLE_PREFIX}}comments( + comment_id SERIAL, + page_id text, + namespace text, + subject text, + comment_data text, + name text, + approved smallint default 1, + user_id int NOT NULL DEFAULT -1, + time int NOT NULL DEFAULT 0, + PRIMARY KEY ( comment_id ) +); + +CREATE TABLE {{TABLE_PREFIX}}logs( + log_type varchar(16), + action varchar(16), + time_id int NOT NULL default '0', + date_string varchar(63), + page_id text, + namespace text, + page_text text, + char_tag varchar(40), + author varchar(63), + edit_summary text, + minor_edit smallint +); + +CREATE TABLE {{TABLE_PREFIX}}page_text( + page_id varchar(255), + namespace varchar(16) NOT NULL default 'Article', + page_text text, + char_tag varchar(63) +); + +CREATE TABLE {{TABLE_PREFIX}}pages( + page_order int, + name varchar(255), + urlname varchar(255), + namespace varchar(16) NOT NULL default 'Article', + special smallint default '0', + visible smallint default '1', + comments_on smallint default '1', + protected smallint NOT NULL DEFAULT 0, + wiki_mode smallint NOT NULL DEFAULT 2, + delvotes int NOT NULL default 0, + password varchar(40) NOT NULL DEFAULT '', + delvote_ips text DEFAULT NULL +); + +CREATE TABLE {{TABLE_PREFIX}}session_keys( + session_key varchar(32), + salt varchar(32), + user_id int, + auth_level smallint NOT NULL default '0', + source_ip varchar(10) default '0x7f000001', + time bigint default '0' +); + +CREATE TABLE {{TABLE_PREFIX}}themes( + theme_id varchar(63), + theme_name text, + theme_order smallint NOT NULL default '1', + default_style varchar(63) NOT NULL DEFAULT '', + enabled smallint NOT NULL default '1' +); + +CREATE TABLE {{TABLE_PREFIX}}users( + user_id SERIAL, + username text, + password varchar(255), + email text, + real_name text, + user_level smallint NOT NULL default 2, + theme varchar(64) NOT NULL default 'bleu.css', + style varchar(64) NOT NULL default 'default', + signature text, + reg_time int NOT NULL DEFAULT 0, + account_active smallint NOT NULL DEFAULT 0, + activation_key varchar(40) NOT NULL DEFAULT 0, + old_encryption smallint NOT NULL DEFAULT 0, + temp_password text, + temp_password_time int NOT NULL DEFAULT 0, + user_coppa smallint NOT NULL DEFAULT 0, + PRIMARY KEY (user_id) +); + +CREATE TABLE {{TABLE_PREFIX}}users_extra( + user_id int NOT NULL, + user_aim varchar(63), + user_yahoo varchar(63), + user_msn varchar(255), + user_xmpp varchar(255), + user_homepage text, + user_location text, + user_job text, + user_hobbies text, + email_public smallint NOT NULL DEFAULT 0, + PRIMARY KEY ( user_id ) +); + +CREATE TABLE {{TABLE_PREFIX}}banlist( + ban_id SERIAL, + ban_type smallint, + ban_value varchar(64), + is_regex smallint DEFAULT 0, + reason text, + PRIMARY KEY ( ban_id ) +); + +CREATE TABLE {{TABLE_PREFIX}}files( + file_id SERIAL, + time_id int NOT NULL, + page_id varchar(63) NOT NULL, + filename varchar(127) default NULL, + size bigint NOT NULL, + mimetype varchar(63) default NULL, + file_extension varchar(8) default NULL, + file_key varchar(32) NOT NULL, + PRIMARY KEY (file_id) +); + +CREATE TABLE {{TABLE_PREFIX}}buddies( + buddy_id SERIAL, + user_id int, + buddy_user_id int, + is_friend smallint NOT NULL default '1', + PRIMARY KEY (buddy_id) +); + +CREATE TABLE {{TABLE_PREFIX}}privmsgs( + message_id SERIAL, + message_from varchar(63), + message_to varchar(255), + date int, + subject varchar(63), + message_text text, + folder_name varchar(63), + message_read smallint NOT NULL DEFAULT 0, + PRIMARY KEY (message_id) +); + +CREATE TABLE {{TABLE_PREFIX}}sidebar( + item_id SERIAL, + item_order smallint NOT NULL DEFAULT 0, + item_enabled smallint NOT NULL DEFAULT 1, + sidebar_id smallint NOT NULL DEFAULT 1, + block_name varchar(63) NOT NULL, + block_type smallint NOT NULL DEFAULT 0, + block_content text, + PRIMARY KEY ( item_id ) +); + +CREATE TABLE {{TABLE_PREFIX}}hits( + hit_id SERIAL, + username varchar(63) NOT NULL, + time int NOT NULL DEFAULT 0, + page_id varchar(63), + namespace varchar(63), + PRIMARY KEY ( hit_id ) +); + +CREATE TABLE {{TABLE_PREFIX}}search_index( + word varchar(64) NOT NULL, + page_names text, + PRIMARY KEY ( word ) +); + +CREATE TABLE {{TABLE_PREFIX}}groups( + group_id SERIAL, + group_name varchar(64), + group_type smallint NOT NULL DEFAULT 1, + PRIMARY KEY ( group_id ), + system_group smallint NOT NULL DEFAULT 0 +); + +CREATE TABLE {{TABLE_PREFIX}}group_members( + member_id SERIAL, + group_id int NOT NULL, + user_id int NOT NULL, + is_mod smallint NOT NULL DEFAULT 0, + pending smallint NOT NULL DEFAULT 0, + PRIMARY KEY ( member_id ) +); + +CREATE TABLE {{TABLE_PREFIX}}acl( + rule_id SERIAL, + target_type smallint NOT NULL, + target_id int NOT NULL, + page_id varchar(255), + namespace varchar(24), + rules text, + PRIMARY KEY ( rule_id ) +); + +-- Added in 1.0.1 + +CREATE TABLE {{TABLE_PREFIX}}page_groups( + pg_id SERIAL, + pg_type smallint NOT NULL DEFAULT 1, + pg_name varchar(255) NOT NULL DEFAULT '', + pg_target varchar(255) DEFAULT NULL, + PRIMARY KEY ( pg_id ) +); + +-- Added in 1.0.1 + +CREATE TABLE {{TABLE_PREFIX}}page_group_members( + pg_member_id SERIAL, + pg_id int NOT NULL, + page_id varchar(63) NOT NULL, + namespace varchar(63) NOT NULL DEFAULT 'Article', + PRIMARY KEY ( pg_member_id ) +); + +-- Added in 1.0.1 + +CREATE TABLE {{TABLE_PREFIX}}tags( + tag_id SERIAL, + tag_name varchar(63) NOT NULL DEFAULT 'bla', + page_id varchar(255) NOT NULL, + namespace varchar(255) NOT NULL, + user_id int NOT NULL DEFAULT 1, + PRIMARY KEY ( tag_id ) +); + +-- Added in 1.1.1 + +CREATE TABLE {{TABLE_PREFIX}}lockout( + id SERIAL, + ipaddr varchar(40) NOT NULL, + action varchar(20) NOT NULL DEFAULT 'credential', + timestamp int NOT NULL DEFAULT 0, + CHECK ( action IN ('credential', 'level') ) +); + +-- Added in 1.1.1 + +CREATE TABLE {{TABLE_PREFIX}}language( + lang_id SERIAL, + lang_code varchar(16) NOT NULL, + lang_name_default varchar(64) NOT NULL, + lang_name_native varchar(64) NOT NULL, + last_changed int NOT NULL DEFAULT 0 +); + +-- Added in 1.1.1 + +CREATE TABLE {{TABLE_PREFIX}}language_strings( + string_id SERIAL, + lang_id int NOT NULL, + string_category varchar(32) NOT NULL, + string_name varchar(64) NOT NULL, + string_content text NOT NULL +); + +DELETE FROM {{TABLE_PREFIX}}config; + +INSERT INTO {{TABLE_PREFIX}}config(config_name, config_value) VALUES + ('site_name', '{{SITE_NAME}}'), + ('main_page', 'Main_Page'), + ('site_desc', '{{SITE_DESC}}'), + ('wiki_mode', '{{WIKI_MODE}}'), + ('wiki_edit_notice', '0'), + ('sflogo_enabled', '0'), + ('sflogo_groupid', ''), + ('sflogo_type', '1'), + ('w3c_vh32', '0'), + ('w3c_vh40', '0'), + ('w3c_vh401', '0'), + ('w3c_vxhtml10', '0'), + ('w3c_vxhtml11', '0'), + ('w3c_vcss', '0'), + ('approve_comments', '0'), + ('enable_comments', '1'), + ('plugin_SpecialAdmin.php', '1'), + ('plugin_SpecialPageFuncs.php', '1'), + ('plugin_SpecialUserFuncs.php', '1'), + ('plugin_SpecialCSS.php', '1'), + ('copyright_notice', '{{COPYRIGHT}}'), + ('wiki_edit_notice_text', '== Why can I edit this page? ==\n\nEveryone can edit almost any page in this website. This concept is called a wiki. It gives everyone the opportunity to make a change for the best. While some spam and vandalism may occur, it is believed that most contributions will be legitimate and helpful.\n\nFor security purposes, a history of all page edits is kept, and administrators are able to restore vandalized or spammed pages with just a few clicks.'), + ('cache_thumbs', '{{ENABLE_CACHE}}'), + ('max_file_size', '256000'),('enano_version', '{{VERSION}}'),( 'allowed_mime_types', 'cbf:len=185;crc=55fb6f14;data=0[1],1[4],0[3],1[1],0[22],1[1],0[16],1[3],0[16],1[1],0[1],1[2],0[6],1[1],0[1],1[1],0[4],1[2],0[3],1[1],0[48],1[2],0[2],1[1],0[4],1[1],0[37]|end' ), + ('contact_email', '{{ADMIN_EMAIL}}'), + ('powered_btn', '1'); + +INSERT INTO {{TABLE_PREFIX}}page_text(page_id, namespace, page_text, char_tag) VALUES + ('Main_Page', 'Article', '=== Enano has been successfully installed and is working. ===\n\nIf you can see this message, it means that you\'ve finished the Enano setup process and are ready to start building your website. Congratulations!\n\nTo edit this front page, click the Log In button to the left, enter the credentials you provided during the installation, and click the Edit This Page button that appears on the blue toolbar just above this text. You can also [http://docs.enanocms.org/Help:2.4 learn more] about editing pages.\n\nTo create more pages, use the Create a Page button to the left. If you enabled wiki mode, you don\'t have to log in first, however your IP address will be shown in the page history.\n\nVisit the [http://docs.enanocms.org/Help:Contents Enano documentation project website] to learn more about administering your site effectively and keeping things secure.\n\n\'\'\'NOTE:\'\'\' You\'ve just installed an unstable version of Enano. This release is completely unsupported and may contain security issues or serious usability bugs. You should not use this release on a production website. The Enano team will not provide any type of support at all for this experimental release.', ''); + +INSERT INTO {{TABLE_PREFIX}}pages(page_order, name, urlname, namespace, special, visible, comments_on, protected, delvotes, delvote_ips) VALUES + (NULL, 'Main Page', 'Main_Page', 'Article', 0, 1, 1, 1, 0, ''); + +INSERT INTO {{TABLE_PREFIX}}themes(theme_id, theme_name, theme_order, default_style, enabled) VALUES + ('oxygen', 'Oxygen', 1, 'bleu.css', 1), + ('stpatty', 'St. Patty', 2, 'shamrock.css', 1); + +INSERT INTO {{TABLE_PREFIX}}users(user_id, username, password, email, real_name, user_level, theme, style, signature, reg_time, account_active) VALUES + (1, 'Anonymous', 'invalid-pass-hash', 'anonspam@enanocms.org', 'None', 1, 'oxygen', 'bleu', '', 0, 0), + (2, '{{ADMIN_USER}}', '{{ADMIN_PASS}}', '{{ADMIN_EMAIL}}', '{{REAL_NAME}}', 9, 'oxygen', 'bleu', '', {{UNIX_TIME}}, 1); + +INSERT INTO {{TABLE_PREFIX}}users_extra(user_id) VALUES + (2); + +INSERT INTO {{TABLE_PREFIX}}groups(group_id,group_name,group_type,system_group) VALUES(1, 'Everyone', 3, 1), + (2,'Administrators',3,1), + (3,'Moderators',3,1); + +INSERT INTO {{TABLE_PREFIX}}group_members(group_id,user_id,is_mod) VALUES(2, 2, 1); + +INSERT INTO {{TABLE_PREFIX}}acl(target_type,target_id,page_id,namespace,rules) VALUES + (1,2,NULL,NULL,'read=4;post_comments=4;edit_comments=4;edit_page=4;view_source=4;mod_comments=4;history_view=4;history_rollback=4;history_rollback_extra=4;protect=4;rename=4;clear_logs=4;vote_delete=4;vote_reset=4;delete_page=4;tag_create=4;tag_delete_own=4;tag_delete_other=4;set_wiki_mode=4;password_set=4;password_reset=4;mod_misc=4;edit_cat=4;even_when_protected=4;upload_files=4;upload_new_version=4;create_page=4;php_in_pages={{ADMIN_EMBED_PHP}};edit_acl=4;'), + (1,3,NULL,NULL,'read=4;post_comments=4;edit_comments=4;edit_page=4;view_source=4;mod_comments=4;history_view=4;history_rollback=4;history_rollback_extra=4;protect=4;rename=3;clear_logs=2;vote_delete=4;vote_reset=4;delete_page=4;set_wiki_mode=2;password_set=2;password_reset=2;mod_misc=2;edit_cat=4;even_when_protected=4;upload_files=2;upload_new_version=3;create_page=3;php_in_pages=2;edit_acl=2;'); + +INSERT INTO {{TABLE_PREFIX}}sidebar(item_id, item_order, sidebar_id, block_name, block_type, block_content) VALUES + (1, 1, 1, '{lang:sidebar_title_navigation}', 1, '[[Main_Page|{lang:sidebar_btn_home}]]'), + (2, 2, 1, '{lang:sidebar_title_tools}', 1, '[[$NS_SPECIAL$CreatePage|{lang:sidebar_btn_createpage}]]\n[[$NS_SPECIAL$UploadFile|{lang:sidebar_btn_uploadfile}]]\n[[$NS_SPECIAL$SpecialPages|{lang:sidebar_btn_specialpages}]]\n{if auth_admin}\n$ADMIN_LINK$\n[[$NS_SPECIAL$EditSidebar|{lang:sidebar_btn_editsidebar}]]\n{/if}'), + (3, 3, 1, '$USERNAME$', 1, '[[$NS_USER$$USERNAME$|{lang:sidebar_btn_userpage}]]\n[[$NS_SPECIAL$Contributions/$USERNAME$|{lang:sidebar_btn_mycontribs}]]\n{if user_logged_in}\n[[$NS_SPECIAL$Preferences|{lang:sidebar_btn_preferences}]]\n[[$NS_SPECIAL$PrivateMessages|{lang:sidebar_btn_privatemessages}]]\n[[$NS_SPECIAL$Usergroups|{lang:sidebar_btn_groupcp}]]\n$THEME_LINK$\n{/if}\n{if user_logged_in}\n$LOGOUT_LINK$\n{else}\n[[$NS_SPECIAL$Register|{lang:sidebar_btn_register}]]\n$LOGIN_LINK$\n[[$NS_SPECIAL$Login/$NS_SPECIAL$PrivateMessages|{lang:sidebar_btn_privatemessages}]]\n{/if}'), + (4, 4, 1, '{lang:sidebar_title_search}', 1, ''), + (5, 2, 2, '{lang:sidebar_title_links}', 4, 'Links'); + diff -r 299a90e28abc -r 87e08a6e4fec language/english/admin.json --- a/language/english/admin.json Thu Jan 03 18:39:19 2008 -0500 +++ b/language/english/admin.json Wed Jan 16 13:55:49 2008 -0500 @@ -218,6 +218,11 @@ field_activate_user: 'User', field_activate_admin: 'Admin', + // Section: terms of use (TOU) + heading_tou: 'Registration agreement/Terms of Use', + field_tou: 'Registration agreement', + field_tou_hint: 'The text you enter here will be displayed to users upon any attempt to create an account on this site.', + // Section: account lockouts heading_lockout: 'Account lockouts', lockout_intro: 'Configure Enano to prevent or restrict logins for a specified period of time if a user enters an incorrect password a specific number of times.', diff -r 299a90e28abc -r 87e08a6e4fec language/english/install.json --- a/language/english/install.json Thu Jan 03 18:39:19 2008 -0500 +++ b/language/english/install.json Wed Jan 16 13:55:49 2008 -0500 @@ -15,7 +15,7 @@ var enano_lang_install = { categories: [ - 'meta', 'welcome', 'license', 'sysreqs', 'database', 'website', 'login', 'confirm', 'install', 'finish', 'pophelp', + 'meta', 'language', 'welcome', 'license', 'sysreqs', 'database', 'dbmysql', 'dbpgsql', 'website', 'login', 'confirm', 'install', 'finish', 'pophelp', ], strings: { meta: { @@ -26,6 +26,7 @@ btn_article: 'installation page', btn_continue: 'Continue', lbl_before_continue: 'Before continuing:', + step: 'Step %step%: %title%', 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.', @@ -34,6 +35,9 @@ msg_err_stagefailed_mysqlerror: 'The error returned from MySQL was:', btn_retry_installation: 'Retry installation', }, + language: { + modetitle: 'Language', + }, welcome: { modetitle: 'Welcome', heading: 'Welcome to Enano', @@ -44,7 +48,8 @@ btn_start: 'Start installation', }, license: { - modetitle: 'License agreement', + modetitle: 'License', + modetitle_long: '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.', @@ -57,11 +62,13 @@ 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', + modetitle: 'Requirements', + modetitle_long: '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_php5: 'PHP 5.2.0 or later', + req_postgres: 'PostgreSQL extension for PHP', req_mysql: 'MySQL extension for PHP', req_uploads: 'File upload support', req_apache: 'Apache HTTP Server', @@ -72,6 +79,7 @@ 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_php5: 'Your server does not have support for PHP 5.2.0. While you may continue installing Enano, please be warned that as of December 31, 2007, all support for Enano on PHP 4 servers is discontinued. If you have at least PHP 5.0.0, support will still be available, but there are many security problems in PHP versions under 5.2.0 that Enano cannot effectively prevent.', + req_desc_postgres: 'It seems that your PHP installation does not have the PostgreSQL extension enabled. Because of this, you won\'t be able to use the PostgreSQL database driver. This is OK in the majority of cases. If you want to use PostgreSQL support, you\'ll need to either compile the PHP extension for Postgres or install the extension with your distribution\'s package manager. Windows administrators will need enable php_pgsql.dll in their php.ini.', 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.', @@ -92,9 +100,24 @@ 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', + modetitle: 'Database', + modetitle_long: 'Database information', heading_optionalinfo: 'Optional information', + driver_heading: 'Choose a database driver', + driver_intro: 'The next step is to choose the database driver that Enano will use. In most cases this is MySQL, but there are certain advantages to PostgreSQL, which is made available only experimentally.', + driver_msg_virt_appliance: 'You\'re using the Enano virtual appliance.You have finished installing Enano on this server.
' . $lang->get('user_reg_err_disabled_body_adminblurb', array( 'reg_link' => makeUrl($paths->page, 'IWannaPlayToo&coppa=no', true) )) . '
' : ''; @@ -527,6 +529,10 @@ { $s = 'Invalid COPPA input'; } + else if ( !empty($terms) && !isset($_POST['tou_agreed']) ) + { + $s = $lang->get('user_reg_err_accept_tou'); + } else { $coppa = ( isset($_POST['coppa']) && $_POST['coppa'] == 'yes' ); @@ -723,10 +729,44 @@ + + + + ++ +
+Your user account does not have permission to perform an upgrade of Enano. Return to the index page.
'; - $template->footer(); - exit; - } - if($session->user_logged_in && $session->user_level >= $ul_admin) - { - if(isset($_POST['login'])) - { - $result = $session->login_without_crypto($_POST['username'], $_POST['password'], false, $ul_admin); - if($session->sid_super) - { - header('Location: upgrade.php?mode=welcome&auth='.$session->sid_super); - exit; - } - } - $template->header(); - ?> - - login_without_crypto($_POST['username'], $_POST['password'], false, $ul_member); - if($result == 'success') - { - header('Location: upgrade.php'); - exit; - } - } - $template->header(); - ?> - - sid_super) { $template->header(); echo 'No admin session found! Please restart the upgrade.
'; $template->footer(); exit; } - - // Just show a simple welcome page to display version information - $template->header(); - require('config.php'); - - ?> - -You are about to upgrade Enano to version . Before you continue, please ensure that:
-No admin session found! Please restart the upgrade.
'; $template->footer(); exit; } - $v = ( function_exists('enano_version') ) ? enano_version() : ''; - if(!in_array($v, $valid_versions) && $v != '') - { - $template->header(); - ?> -Your version of Enano () can't be upgraded to this version ().
- header(); - echo " - header(); - if(!$session->sid_super) { echo 'No admin session found! Please restart the upgrade.
'; $template->footer(); exit; } - if(!isset($_POST['enano_version'])) { echo 'Can\'t find the version information on the POST query, are you trying to do this upgrade directly? Please restart the upgrade.
'; break; } - $enano_version = $_POST['enano_version']; - echo 'Preparing for schema execution...'; - // Build an array of queries - $schema = file_get_contents('upgrade.sql'); - - // Strip out and process version blocks - preg_match_all('#---BEGIN ([0-9A-z\.\-]*?)---'."\n".'((.*?)'."\n)?".'---END \\1---#is', $schema, $matches); - - $from_list =& $matches[1]; - $query_list =& $matches[3]; - - foreach($matches[0] as $m) - { - $schema = str_replace($m, '', $schema); - } - $schema = explode("\n", $schema); - foreach($schema as $k => $q) - { - if(substr($q, 0, 2) == '--' || $q == '') - { - unset($schema[$k]); - //die('
'.htmlspecialchars(print_r($schema, true)).''); - } - else - { - $schema[$k] = upg_assign_vars($schema[$k]); - } - } - - foreach($query_list as $k => $q) - { - $query_list[$k] = explode("\n", $query_list[$k]); - foreach($query_list[$k] as $i => $s) - { - $tq =& $query_list[$k][$i]; - if(substr($s, 0, 2) == '--' || $s == '') - { - unset($query_list[$k][$i]); - //die('
'.htmlspecialchars(print_r($schema, true)).''); - } - else - { - $query_list[$k][$i] = upg_assign_vars($query_list[$k][$i]); - } - } - $query_list[$k] = array_values($query_list[$k]); - } - - $assoc_list = Array(); - - foreach($from_list as $i => $v) - { - $assoc_list[$v] = $query_list[$i]; - } - - $schema = array_values($schema); - - $deps_resolved = false; - $installing_versions = Array($enano_version); - - while(true) - { - $v = array_keys($deps_list); - foreach($v as $i => $ver) - { - if(in_array($ver, $installing_versions)) - { - // $ver is on the list of versions to be installed. Add its dependencies to the list of versions to install. - foreach($deps_list[$ver] as $dep) - { - if(!in_array($dep, $installing_versions)) - { - $installing_versions[] = $dep; - } - } - } - if($i == count($deps_list) - 1) - { - break 2; - } - } - } - - foreach($installing_versions as $this_ver) - { - $schema = array_merge($schema, $assoc_list[$this_ver]); - } - - // Time for some proper SQL syntax! - // Also check queries for so-called injection attempts to make - // sure that it doesn't fail during the upgrade process and - // leave the user with a half-upgraded database - foreach($schema as $s => $q) - { - if(substr($q, strlen($q)-1, 1) != ';') - { - $schema[$s] .= ';'; - } - if ( !$db->check_query($schema[$s]) ) - { - // Uh-oh, the check failed, bail out - // The DBAL runs sanity checks on all queries for safety, - // so if the check fails in mid-upgrade we are in deep - // dodo doo-doo. - echo 'Query failed sanity check, this should never happen and is a bug.
Query was:
'.$schema[$s].''; - break 2; - } - } - - $schema = array_values($schema); - - // Used extensively for debugging - // echo '
'.htmlspecialchars(print_r($schema, true)).''; - // break; - - echo 'done!
You will be redirected shortly. If you aren\'t redirected, click here.
- '; - break; -} -$template->footer(); - -?>