# HG changeset patch # User Dan # Date 1200630695 18000 # Node ID 2398420f48e7a186eda84fa546ac7b91cabccb1c # Parent dd7cbc97f681e1f7646d6a0acf0eab60fd55cadd# Parent 9d7225c0db6d964b38b00c41e62135ec4397eb43 Dropping changes from revision 350 (dd7cbc97f681) diff -r dd7cbc97f681 -r 2398420f48e7 includes/common.php --- a/includes/common.php Thu Jan 17 09:39:56 2008 -0500 +++ b/includes/common.php Thu Jan 17 23:31:35 2008 -0500 @@ -259,35 +259,6 @@ setConfig('default_language', $row['lang_id']); } -// Our list of tables included in Enano -$system_table_list = Array( - table_prefix.'categories', - table_prefix.'comments', - table_prefix.'config', - table_prefix.'logs', - table_prefix.'page_text', - table_prefix.'session_keys', - table_prefix.'pages', - table_prefix.'users', - table_prefix.'users_extra', - table_prefix.'themes', - table_prefix.'buddies', - table_prefix.'banlist', - table_prefix.'files', - table_prefix.'privmsgs', - table_prefix.'sidebar', - table_prefix.'hits', - table_prefix.'groups', - table_prefix.'group_members', - table_prefix.'acl', - table_prefix.'page_groups', - table_prefix.'page_group_members', - table_prefix.'tags', - table_prefix.'language', - table_prefix.'language_strings', - table_prefix.'lockout' - ); - // Load plugin manager $plugins = new pluginLoader(); diff -r dd7cbc97f681 -r 2398420f48e7 includes/constants.php --- a/includes/constants.php Thu Jan 17 09:39:56 2008 -0500 +++ b/includes/constants.php Thu Jan 17 23:31:35 2008 -0500 @@ -141,6 +141,44 @@ // significantly increase encryption strength either. define('AES_BLOCKSIZE', 128); +// Our list of tables included in Enano +$system_table_list = Array( + 'categories', + 'comments', + 'config', + 'logs', + 'page_text', + 'session_keys', + 'pages', + 'users', + 'users_extra', + 'themes', + 'buddies', + 'banlist', + 'files', + 'privmsgs', + 'sidebar', + 'hits', + 'groups', + 'group_members', + 'acl', + 'page_groups', + 'page_group_members', + 'tags', + 'language', + 'language_strings', + 'lockout', + 'search_index' + ); + +if ( defined('table_prefix') ) +{ + foreach ( $system_table_list as $i => $_ ) + { + $system_table_list[$i] = table_prefix . $system_table_list[$i]; + } +} + /* * MIMETYPES * diff -r dd7cbc97f681 -r 2398420f48e7 includes/dbal.php --- a/includes/dbal.php Thu Jan 17 09:39:56 2008 -0500 +++ b/includes/dbal.php Thu Jan 17 23:31:35 2008 -0500 @@ -199,7 +199,11 @@ $q = $this->sql_query('USE `'.$dbname.'`;'); if ( !$q ) + { + if ( $manual_credentials ) + return false; $this->_die('The database could not be selected.'); + } // We're in! $this->disable_errorhandler(); diff -r dd7cbc97f681 -r 2398420f48e7 includes/pageutils.php --- a/includes/pageutils.php Thu Jan 17 09:39:56 2008 -0500 +++ b/includes/pageutils.php Thu Jan 17 23:31:35 2008 -0500 @@ -211,7 +211,7 @@ if ($db->numrows() > 0 ) { $r = $db->fetchrow(); - echo '

This page also appears to have some log entries in the database - it seems that it was deleted on ' . $r['date_string'] . '. You can probably roll back the deletion.

'; + echo '

This page also appears to have some log entries in the database - it seems that it was deleted on ' . enano_date('d M Y h:i a', intval($r['time_id'])) . '. You can probably roll back the deletion.

'; } $db->free_result(); } @@ -258,7 +258,7 @@ } $r = $db->fetchrow(); $db->free_result(); - $message = '
Notice:
The page you are viewing was archived on ' . $r['date_string'] . '.
View current version | Restore this version

'.RenderMan::render($r['page_text']); + $message = '
Notice:
The page you are viewing was archived on ' . enano_date('d M Y h:i a', intval($r['time_id'])) . '.
View current version | Restore this version

'.RenderMan::render($r['page_text']); if( !$paths->pages[$page]['special'] ) { @@ -618,7 +618,7 @@ if($ticker < $numrows) echo ''."\n"; else echo ''; // Date and time - echo '' . $r['date_string'] . ''."\n"; + echo '' . enano_date('d M Y h:i a', intval($r['time_id'])) . ''."\n"; // User if ( $session->get_permissions('mod_misc') && is_valid_ip($r['author']) ) @@ -694,7 +694,7 @@ echo ''; // Date and time - echo '' . $r['date_string'] . ''; + echo '' . enano_date('d M Y h:i a', intval($r['time_id'])) . ''; // User echo 'pages[$paths->nslist[$rb['namespace']].$rb['page_id']]['name'].'" has been rolled back to the state it was in on ' . $rb['date_string'] . '.'; + return 'The page "' . $paths->pages[$paths->nslist[$rb['namespace']].$rb['page_id']]['name'].'" has been rolled back to the state it was in on ' . enano_date('d M Y h:i a', intval($rb['time_id'])) . '.'; } break; case "rename": @@ -825,7 +825,7 @@ } else { - return 'The page "' . $paths->pages[$paths->nslist[$rb['namespace']].$rb['page_id']]['name'].'" has been rolled back to the name it had ("' . $rb['edit_summary'] . '") before ' . $rb['date_string'] . '.'; + return 'The page "' . $paths->pages[$paths->nslist[$rb['namespace']].$rb['page_id']]['name'].'" has been rolled back to the name it had ("' . $rb['edit_summary'] . '") before ' . enano_date('d M Y h:i a', intval($rb['time_id'])) . '.'; } break; case "prot": @@ -835,7 +835,7 @@ if ( !$e ) return "An error occurred during the rollback operation.\nMySQL said: ".$db->get_error()."\n\nSQL backtrace:\n".$db->sql_backtrace(); else - return 'The page "' . $paths->pages[$paths->nslist[$rb['namespace']].$rb['page_id']]['name'].'" has been unprotected according to the log created at ' . $rb['date_string'] . '.'; + return 'The page "' . $paths->pages[$paths->nslist[$rb['namespace']].$rb['page_id']]['name'].'" has been unprotected according to the log created at ' . enano_date('d M Y h:i a', intval($rb['time_id'])) . '.'; break; case "semiprot": if ( !$perms->get_permissions('protect') ) @@ -844,7 +844,7 @@ if ( !$e ) return "An error occurred during the rollback operation.\nMySQL said: ".$db->get_error()."\n\nSQL backtrace:\n".$db->sql_backtrace(); else - return 'The page "' . $paths->pages[$paths->nslist[$rb['namespace']].$rb['page_id']]['name'].'" has been unprotected according to the log created at ' . $rb['date_string'] . '.'; + return 'The page "' . $paths->pages[$paths->nslist[$rb['namespace']].$rb['page_id']]['name'].'" has been unprotected according to the log created at ' . enano_date('d M Y h:i a', intval($rb['time_id'])) . '.'; break; case "unprot": if ( !$perms->get_permissions('protect') ) @@ -853,7 +853,7 @@ if ( !$e ) return "An error occurred during the rollback operation.\nMySQL said: ".$db->get_error()."\n\nSQL backtrace:\n".$db->sql_backtrace(); else - return 'The page "' . $paths->pages[$paths->nslist[$rb['namespace']].$rb['page_id']]['name'].'" has been protected according to the log created at ' . $rb['date_string'] . '.'; + return 'The page "' . $paths->pages[$paths->nslist[$rb['namespace']].$rb['page_id']]['name'].'" has been protected according to the log created at ' . enano_date('d M Y h:i a', intval($rb['time_id'])) . '.'; break; case "delete": if ( !$perms->get_permissions('history_rollback_extra') ) @@ -865,7 +865,7 @@ $e = $db->sql_query('SELECT page_text,char_tag FROM ' . table_prefix.'logs WHERE page_id=\'' . $rb['page_id'] . '\' AND namespace=\'' . $rb['namespace'] . '\' AND log_type=\'page\' AND action=\'edit\' ORDER BY time_id DESC;'); if(!$e) return("An error occurred during the rollback operation.\nMySQL said: ".$db->get_error()."\n\nSQL backtrace:\n".$db->sql_backtrace()); $r = $db->fetchrow(); $e = $db->sql_query('INSERT INTO ' . table_prefix.'page_text(page_id,namespace,page_text,char_tag) VALUES(\'' . $rb['page_id'] . '\',\'' . $rb['namespace'] . '\',\'' . $db->escape($r['page_text']) . '\',\'' . $r['char_tag'] . '\')'); if(!$e) return("An error occurred during the rollback operation.\nMySQL said: ".$db->get_error()."\n\nSQL backtrace:\n".$db->sql_backtrace()); - return 'The page "' . $name . '" has been undeleted according to the log created at ' . $rb['date_string'] . '.'; + return 'The page "' . $name . '" has been undeleted according to the log created at ' . enano_date('d M Y h:i a', intval($rb['time_id'])) . '.'; break; case "reupload": if ( !$session->get_permissions('history_rollback_extra') ) @@ -1453,7 +1453,7 @@ // This is a special exception for the Enano installer, which doesn't init languages yet. $lang = new Language('eng'); } - if(!$session->get_permissions('clear_logs')) + if(!$session->get_permissions('clear_logs') && !defined('IN_ENANO_INSTALL')) { return $lang->get('etc_access_denied'); } diff -r dd7cbc97f681 -r 2398420f48e7 includes/paths.php --- a/includes/paths.php Thu Jan 17 09:39:56 2008 -0500 +++ b/includes/paths.php Thu Jan 17 23:31:35 2008 -0500 @@ -145,7 +145,7 @@ } $db->free_result(); - if ( defined('ENANO_INTERFACE_INDEX') || defined('ENANO_INTERFACE_AJAX') || defined('IN_ENANO_INSTALL') || defined('IN_ENANO_UPGRADE') ) + if ( defined('ENANO_INTERFACE_INDEX') || defined('ENANO_INTERFACE_AJAX') || defined('IN_ENANO_UPGRADE') ) { if( isset($_GET['title']) ) { diff -r dd7cbc97f681 -r 2398420f48e7 includes/payload.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/includes/payload.php Thu Jan 17 23:31:35 2008 -0500 @@ -0,0 +1,312 @@ +sql_query('SELECT config_value FROM ' . table_prefix . 'config WHERE config_name=\'install_aes_key\';'); + if ( !$q ) + $db->_die(); + if ( $db->numrows() < 1 ) + return false; + list($aes_key) = $db->fetchrow_num(); + $aes_key = $aes->hextostring($aes_key); + + $pass = $aes->decrypt($_POST['crypt_data'], $aes_key, ENC_HEX); + if ( !$pass ) + return false; + + return $pass; // Will be true if the password isn't crapped +} + +function stg_make_private_key() +{ + global $db; + static $site_key = false; + + if ( $site_key ) + return $site_key; + + // Is there already a key cached in the database? + $q = $db->sql_query('SELECT config_value FROM ' . table_prefix . 'config WHERE config_name=\'site_aes_key\';'); + if ( !$q ) + $db->_die(); + + if ( $db->numrows() > 0 ) + { + list($site_key) = $db->fetchrow_num(); + $db->free_result(); + return $site_key; + } + + $aes = AESCrypt::singleton(AES_BITS, AES_BLOCKSIZE); + // This will use /dev/urandom if possible + $site_key = $aes->gen_readymade_key(); + + // Stash it in the database, don't check for errors though because we can always regenerate it + $db->sql_query('INSERT INTO ' . table_prefix . 'config ( config_name, config_value ) VALUES ( \'site_aes_key\', \'' . $site_key . '\' );'); + + return $site_key; +} + +function stg_load_schema() +{ + global $db, $dbdriver, $installer_version; + static $sql_parser = false; + + if ( is_object($sql_parser) ) + return $sql_parser->parse(); + + $aes = AESCrypt::singleton(AES_BITS, AES_BLOCKSIZE); + + $site_key = stg_make_private_key(); + $site_key = $aes->hextostring($site_key); + $admin_pass_clean = stg_password_decode(); + $admin_pass = $aes->encrypt($admin_pass_clean, $site_key, ENC_HEX); + + unset($admin_pass_clean); // Security + + try + { + $sql_parser = new SQL_Parser( ENANO_ROOT . "/install/schemas/{$dbdriver}_stage2.sql" ); + } + catch ( Exception $e ) + { + echo "
$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; +} + +function stg_write_config() +{ + global $dbhost, $dbuser, $dbpasswd, $dbname, $dbdriver; + $db_data = array( + 'host' => str_replace("'", "\\'", $dbhost), + 'user' => str_replace("'", "\\'", $dbuser), + 'pass' => str_replace("'", "\\'", $dbpasswd), + 'name' => str_replace("'", "\\'", $dbname), + 'tp' => table_prefix, + 'drv' => $dbdriver + ); + + // Retrieves the existing key + $site_key = stg_make_private_key(); + + // Determine contentPath + switch ( @$_POST['url_scheme'] ) + { + case 'standard': + default: + $sp_append = 'index.php?title='; + break; + case 'shortened': + $sp_append = 'index.php/'; + break; + case 'rewrite': + $sp_append = '/'; + break; + } + + $scriptpath = scriptPath; + $contentpath = $scriptpath . $sp_append; + + $config_file = <<import( ENANO_ROOT . "/language/{$lang_info['dir']}/user.json" ); + $lang_local->import( ENANO_ROOT . "/language/{$lang_info['dir']}/tools.json" ); + $lang_local->import( ENANO_ROOT . "/language/{$lang_info['dir']}/admin.json" ); + + return true; +} diff -r dd7cbc97f681 -r 2398420f48e7 install/includes/libenanoinstall.php --- a/install/includes/libenanoinstall.php Thu Jan 17 09:39:56 2008 -0500 +++ b/install/includes/libenanoinstall.php Thu Jan 17 23:31:35 2008 -0500 @@ -99,15 +99,18 @@ $key = htmlspecialchars($key); $post_data .= " \n"; } - echo '
- ' . $post_data . ' - -

' . $lang->get('meta_msg_err_stagefailed_title') . '

-

' . $failure_explanation . '

- ' . ( !empty($mysql_error) ? "

" . $lang->get('meta_msg_err_stagefailed_mysqlerror') . " $mysql_error

" : '' ) . ' -

' . $lang->get('meta_msg_err_stagefailed_body') . '

-

-
'; + if ( $stage_id == 'renameconfig' ) + echo '

' . $failure_explanation . '

'; + else + echo '
+ ' . $post_data . ' + +

' . $lang->get('meta_msg_err_stagefailed_title') . '

+

' . $failure_explanation . '

+ ' . ( !empty($mysql_error) ? "

" . $lang->get('meta_msg_err_stagefailed_mysqlerror') . " $mysql_error

" : '' ) . ' +

' . $lang->get('meta_msg_err_stagefailed_body') . '

+

+
'; global $ui; $ui->show_footer(); exit; diff -r dd7cbc97f681 -r 2398420f48e7 install/includes/payload.php --- a/install/includes/payload.php Thu Jan 17 09:39:56 2008 -0500 +++ b/install/includes/payload.php Thu Jan 17 23:31:35 2008 -0500 @@ -89,7 +89,7 @@ function stg_load_schema() { - global $db, $dbdriver, $installer_version; + global $db, $dbdriver, $installer_version, $lang_id, $languages; static $sql_parser = false; if ( is_object($sql_parser) ) @@ -114,6 +114,18 @@ return false; } + $wkt = ENANO_ROOT . "/language/{$languages[$lang_id]['dir']}/install/mainpage-default.wkt"; + if ( !file_exists( $wkt ) ) + { + echo '
Error: could not locate wikitext for main page (' . $wkt . ')
'; + return false; + } + $wkt = @file_get_contents($wkt); + if ( empty($wkt) ) + return false; + + $wkt = $db->escape($wkt); + $vars = array( 'TABLE_PREFIX' => $_POST['table_prefix'], 'SITE_NAME' => $db->escape($_POST['site_name']), @@ -128,7 +140,8 @@ 'ADMIN_EMAIL' => $db->escape($_POST['email']), 'REAL_NAME' => '', // This has always been stubbed. 'ADMIN_EMBED_PHP' => strval(AUTH_DISALLOW), - 'UNIX_TIME' => strval(time()) + 'UNIX_TIME' => strval(time()), + 'MAIN_PAGE_CONTENT' => $wkt ); $sql_parser->assign_vars($vars); @@ -310,3 +323,92 @@ return true; } + +function stg_init_logs() +{ + global $db, $session, $paths, $template, $plugins; // Common objects + global $installer_version; + + $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') . '\', \'' . $db->escape($_POST['admin_user']) . '\', \'' . $db->escape(enano_version()) . '\', \'' . $db->escape($_SERVER['REMOTE_ADDR']) . '\');'); + if ( !$q ) + { + echo '

MySQL return: ' . $db->sql_error() . '

'; + return false; + } + + return true; +} + +function stg_aes_cleanup() +{ + global $db, $session, $paths, $template, $plugins; // Common objects + $q = $db->sql_query('DELETE FROM ' . table_prefix . 'config WHERE config_name = \'install_aes_key\' OR config_name = \'site_aes_key\';'); + if ( !$q ) + $db->_die(); + 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(ENANO_ROOT . '/config.new.php', ENANO_ROOT . '/config.php') ) + { + echo '

Can\'t rename config.php

'; + _stg_rename_config_revert(); + return false; + } + + if ( filesize(ENANO_ROOT . '/.htaccess.new') > 1 ) + { + // rename/possibly concatenate .htaccess.new + $htaccess_base = ''; + if ( file_exists(ENANO_ROOT . '/.htaccess') ) + $htaccess_base .= @file_get_contents(ENANO_ROOT . '/.htaccess'); + if ( strlen($htaccess_base) > 0 && !preg_match("/\n$/", $htaccess_base) ) + $htaccess_base .= "\n\n"; + $htaccess_base .= @file_get_contents(ENANO_ROOT . '/.htaccess.new'); + if ( file_exists(ENANO_ROOT . '/.htaccess') ) + { + $hh = @fopen(ENANO_ROOT . '/.htaccess', 'w'); + if ( !$hh ) + return false; + fwrite($hh, $htaccess_base); + fclose($hh); + @unlink(ENANO_ROOT . '/.htaccess.new'); + return true; + } + else + { + return @rename(ENANO_ROOT . '/.htaccess.new', ENANO_ROOT . '/.htaccess'); + } + } + else + { + @unlink(ENANO_ROOT . '/.htaccess.new'); + } + return true; +} + diff -r dd7cbc97f681 -r 2398420f48e7 install/includes/stages/database_post.php --- a/install/includes/stages/database_post.php Thu Jan 17 09:39:56 2008 -0500 +++ b/install/includes/stages/database_post.php Thu Jan 17 23:31:35 2008 -0500 @@ -26,14 +26,68 @@ $db_pass =& $_POST['db_pass']; $db_name =& $_POST['db_name']; $db_prefix =& $_POST['table_prefix']; +$db_root_user =& $_POST['db_root_user']; +$db_root_pass =& $_POST['db_root_pass']; + +if ( !preg_match('/^[a-z0-9_]*$/', $db_prefix) ) +{ + $ui->show_header(); + echo '

That table prefix isn\'t going to work.

'; + return true; +} $result = $dbal->connect(true, $db_host, $db_user, $db_pass, $db_name); +// If connection failed, we have the root login, AND we're on MySQL, try to force our way in +if ( !$result && !empty($_POST['db_root_user']) && !empty($_POST['db_root_pass']) && $driver == 'mysql' ) +{ + // Allow a jump / breakout + switch ( 'foo' ) { case 'foo': + + // Try to connect to the DB as root + $result_root = $dbal->connect(true, $db_host, $db_root_user, $db_root_pass, 'mysql'); + if ( !$result_root ) + break; + + $q = $dbal->sql_query('CREATE DATABASE IF NOT EXISTS `' . $dbal->escape($db_name) . '`;'); + if ( !$q ) + break; + + if ( $db_host == 'localhost' || $db_host == '127.0.0.1' ) + { + $q = $dbal->sql_query('GRANT ALL PRIVILEGES ON `' . $dbal->escape($db_name) . '`.* TO \'' . $dbal->escape($db_user) . '\'@\'localhost\'' . "\n" . + ' IDENTIFIED BY \'' . $dbal->escape($db_pass) . '\' WITH GRANT OPTION'); + } + else + { + $q = $dbal->sql_query('GRANT ALL PRIVILEGES ON `' . $dbal->escape($db_name) . '`.* TO \'' . $dbal->escape($db_user) . '\'@\'%\'' . "\n" . + ' IDENTIFIED BY \'' . $dbal->escape($db_pass) . '\' WITH GRANT OPTION'); + } + + if ( !$q ) + break; + + $dbal->close(); + $result = $dbal->connect(true, $db_host, $db_user, $db_pass, $db_name); + + break; + } +} + $ui->show_header(); if ( $result ) { - // We're good, write out a config file + // We're good, do table drop if requested + if ( isset($_POST['drop_tables']) ) + { + global $system_table_list; + foreach ( $system_table_list as $table ) + { + $dbal->sql_query("DROP TABLE {$db_prefix}$table"); + } + } + // Write out a config file $ch = @fopen( ENANO_ROOT . '/config.new.php', 'w' ); if ( !$ch ) { diff -r dd7cbc97f681 -r 2398420f48e7 install/includes/stages/finish.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/install/includes/stages/finish.php Thu Jan 17 23:31:35 2008 -0500 @@ -0,0 +1,76 @@ +show_header(); + echo '

Installation error

+

ERROR: That database driver is not supported.

'; + return true; +} + +$db = new $dbdriver(); +$db->connect(); + +$ui->show_header(); +flush(); + +?> +

Performing final installation steps

+

Enano is cleaning up and performing some final installation tasks. Please wait...

+ +get('install_stg_buildindex_title'), 'stg_build_index', $lang->get('install_stg_buildindex_body')); +run_installer_stage('renameconfig', $lang->get('install_stg_rename_title'), 'stg_rename_config', $lang->get('install_stg_rename_body', array('mainpage_link' => scriptPath . '/index.php'))); + +close_install_table(); + +?> +

Congratulations! You've finished installing Enano.

+

Enano has finished setting up on your server. Now you can go to your new + website and start creating content!

+get('finish_body'); + echo '

' . $lang->get('finish_link_mainpage', array('mainpage_link' => scriptPath . '/index.php')) . '

'; +?> +close(); + diff -r dd7cbc97f681 -r 2398420f48e7 install/includes/stages/install.php --- a/install/includes/stages/install.php Thu Jan 17 09:39:56 2008 -0500 +++ b/install/includes/stages/install.php Thu Jan 17 23:31:35 2008 -0500 @@ -107,7 +107,19 @@ // Import languages run_installer_stage('importlang', $lang->get('install_stg_importlang_title'), 'stg_language_setup', $lang->get('install_stg_importlang_body')); +// Init logs +run_installer_stage('initlogs', $lang->get('install_stg_initlogs_title'), 'stg_init_logs', $lang->get('install_stg_initlogs_body')); + close_install_table(); +?> +
+ +
+ +
+
+close(); diff -r dd7cbc97f681 -r 2398420f48e7 install/install.php --- a/install/install.php Thu Jan 17 09:39:56 2008 -0500 +++ b/install/install.php Thu Jan 17 23:31:35 2008 -0500 @@ -19,6 +19,7 @@ define('ENANO_DANGEROUS', 1); require_once('includes/common.php'); +@ini_set('display_errors', 'on'); $stages = array('language', 'license', 'sysreqs', 'database', 'website', 'login', 'confirm', 'install', 'finish'); $stage_ids = array(); @@ -268,6 +269,9 @@ case 'install': require( ENANO_ROOT . '/install/includes/stages/install.php' ); break; + case 'finish': + require( ENANO_ROOT . '/install/includes/stages/finish.php' ); + break; } $ui->show_footer(); diff -r dd7cbc97f681 -r 2398420f48e7 install/schemas/mysql_stage2.sql --- a/install/schemas/mysql_stage2.sql Thu Jan 17 09:39:56 2008 -0500 +++ b/install/schemas/mysql_stage2.sql Thu Jan 17 23:31:35 2008 -0500 @@ -181,6 +181,12 @@ 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), @@ -300,7 +306,10 @@ ('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.', ''); + ('Main_Page', 'Article', '{{MAIN_PAGE_CONTENT}}', ''); + +INSERT INTO {{TABLE_PREFIX}}logs(time_id, date_string, log_type, action, page_id, namespace, author, page_text) VALUES + ({{UNIX_TIME}}, 'DEPRECATED', 'page', 'edit', 'Main_Page', 'Article', '{{ADMIN_USER}}', '{{MAIN_PAGE_CONTENT}}'); 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, ''); diff -r dd7cbc97f681 -r 2398420f48e7 install/schemas/postgresql_stage2.sql --- a/install/schemas/postgresql_stage2.sql Thu Jan 17 09:39:56 2008 -0500 +++ b/install/schemas/postgresql_stage2.sql Thu Jan 17 23:31:35 2008 -0500 @@ -177,6 +177,12 @@ 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), diff -r dd7cbc97f681 -r 2398420f48e7 language/english/install.json --- a/language/english/install.json Thu Jan 17 09:39:56 2008 -0500 +++ b/language/english/install.json Thu Jan 17 23:31:35 2008 -0500 @@ -273,7 +273,13 @@ stg_writeconfig_title: 'Write configuration files', stg_writeconfig_body: 'Enano was unable to write the configuration file with your site\'s database credentials. This is almost always because your configuration file does not have the correct permissions. On Windows servers, you may see this message even if the check on the System Requirements page passed. Temporarily running IIS as the Administrator user may help.', stg_rename_title: 'Rename configuration files', - stg_rename_body: 'Enano couldn\'t rename the configuration files to their correct production names. Please CHMOD the folder where your Enano files are to 777 and click the retry button below, or perform the following rename operations and then finish the installation.', + stg_rename_body: 'Enano couldn\'t rename the configuration files to their correct production names. Please perform the following rename operations and then follow the instructions to finish the installation below. + + %this.finish_body% + %this.finish_link_mainpage%', stg_startapi_title: 'Start the Enano API', stg_startapi_body: 'The Enano API could not be started. This is an error that should never occur; please contact the Enano team for support.', stg_importlang_title: 'Import default language', @@ -292,8 +298,7 @@ modetitle: 'Finish', modetitle_long: 'Complete installation', msg_congratulations: 'Congratulations!', - body: '

You have finished installing Enano on this server.

-

Now what?

+ body: '

Wait... Now what?

Click the link below to see the main page for your website. Where to go from here: