diff --git a/phpBB/install/install.php b/phpBB/install/install.php index 7179f38c84..77ff02f128 100644 --- a/phpBB/install/install.php +++ b/phpBB/install/install.php @@ -4,7 +4,7 @@ * ------------------- * begin : Tuesday, Sept 11, 2001 * copyright : (C) 2001 The phpBB Group - * email : supportphpbb.com + * email : support@phpbb.com * * $Id$ * @@ -94,40 +94,6 @@ $available_dbms = array( ) ); -// -// drop table schema -// -$sql_array = array(); - -$sql_array['drop_schema'][] = "DROP TABLE phpbb_auth_access"; -$sql_array['drop_schema'][] = "DROP TABLE phpbb_banlist"; -$sql_array['drop_schema'][] = "DROP TABLE phpbb_categories"; -$sql_array['drop_schema'][] = "DROP TABLE phpbb_config"; -$sql_array['drop_schema'][] = "DROP TABLE phpbb_disallow"; -$sql_array['drop_schema'][] = "DROP TABLE phpbb_forum_prune"; -$sql_array['drop_schema'][] = "DROP TABLE phpbb_forums"; -$sql_array['drop_schema'][] = "DROP TABLE phpbb_groups"; -$sql_array['drop_schema'][] = "DROP TABLE phpbb_posts"; -$sql_array['drop_schema'][] = "DROP TABLE phpbb_posts_text"; -$sql_array['drop_schema'][] = "DROP TABLE phpbb_privmsgs"; -$sql_array['drop_schema'][] = "DROP TABLE phpbb_privmsgs_text"; -$sql_array['drop_schema'][] = "DROP TABLE phpbb_ranks"; -$sql_array['drop_schema'][] = "DROP TABLE phpbb_search_results"; -$sql_array['drop_schema'][] = "DROP TABLE phpbb_search_wordlist"; -$sql_array['drop_schema'][] = "DROP TABLE phpbb_search_wordmatch"; -$sql_array['drop_schema'][] = "DROP TABLE phpbb_sessions"; -$sql_array['drop_schema'][] = "DROP TABLE phpbb_smilies"; -$sql_array['drop_schema'][] = "DROP TABLE phpbb_themes"; -$sql_array['drop_schema'][] = "DROP TABLE phpbb_themes_name"; -$sql_array['drop_schema'][] = "DROP TABLE phpbb_topics"; -$sql_array['drop_schema'][] = "DROP TABLE phpbb_topics_watch"; -$sql_array['drop_schema'][] = "DROP TABLE phpbb_user_group"; -$sql_array['drop_schema'][] = "DROP TABLE phpbb_users"; -$sql_array['drop_schema'][] = "DROP TABLE phpbb_vote_desc"; -$sql_array['drop_schema'][] = "DROP TABLE phpbb_vote_results"; -$sql_array['drop_schema'][] = "DROP TABLE phpbb_vote_voters"; -$sql_array['drop_schema'][] = "DROP TABLE phpbb_words"; - // // Uncomment the following line to completely disable the ftp option... // @@ -139,13 +105,21 @@ $sql_array['drop_schema'][] = "DROP TABLE phpbb_words"; * ***************************************************************************/ +// +// Try opening config file +// +if ( @file_exists('../config.'.$phpEx) ) +{ + include('../config.'.$phpEx); +} + // // Obtain various vars // $confirm = ( isset($HTTP_POST_VARS['confirm']) ) ? true : false; $cancel = ( isset($HTTP_POST_VARS['cancel']) ) ? true : false; -if( isset($HTTP_POST_VARS['install_step']) || isset($HTTP_GET_VARS['install_step']) ) +if ( isset($HTTP_POST_VARS['install_step']) || isset($HTTP_GET_VARS['install_step']) ) { $install_step = ( isset($HTTP_POST_VARS['install_step']) ) ? $HTTP_POST_VARS['install_step'] : $HTTP_GET_VARS['install_step']; } @@ -181,15 +155,7 @@ $board_email = ( !empty($HTTP_POST_VARS['board_email']) ) ? $HTTP_POST_VARS['boa $script_path = ( !empty($HTTP_POST_VARS['script_path']) ) ? $HTTP_POST_VARS['script_path'] : ''; // -// -// -if ( @file_exists('../config.'.$phpEx) ) -{ - include('../config.'.$phpEx); -} - -// -// +// Do we install/upgrade/update or quit back to index? // if ( !defined('PHPBB_INSTALLED') ) { @@ -202,14 +168,9 @@ if ( !defined('PHPBB_INSTALLED') ) include($phpbb_root_path . 'language/lang_' . $language . '/lang_main.'.$phpEx); include($phpbb_root_path . 'language/lang_' . $language . '/lang_admin.'.$phpEx); - // - // Ok for the time being I'm commenting this out whilst I'm working on - // better integration of the install with upgrade as per Bart's request - // JLH - // if ( $upgrade == 1 ) { - // require('upgrade.'.$phpEx); + require('upgrade.'.$phpEx); $install_step = 1; } } @@ -220,13 +181,10 @@ else } // -// +// What shall we do? // if ( !empty($HTTP_POST_VARS['send_file']) && $HTTP_POST_VARS['send_file'] == 1 && !defined("PHPBB_INSTALLED") && empty($HTTP_POST_VARS['upgrade_now']) ) { - header("Content-Type: text/x-delimtext; name=\"config.$phpEx\""); - header("Content-disposition: attachment; filename=config.$phpEx"); - // // We need to stripslashes no matter what the setting of magic_quotes_gpc is // because we add slahes at the top if its off, and they are added automaticlly @@ -234,9 +192,11 @@ if ( !empty($HTTP_POST_VARS['send_file']) && $HTTP_POST_VARS['send_file'] == 1 // $HTTP_POST_VARS['config_data'] = stripslashes($HTTP_POST_VARS['config_data']); + header("Content-Type: text/x-delimtext; name=\"config.$phpEx\""); + header("Content-disposition: attachment; filename=config.$phpEx"); echo $HTTP_POST_VARS['config_data']; - exit; + } else if ( !empty($HTTP_POST_VARS['send_file']) && $HTTP_POST_VARS['send_file'] == 2 && !defined("PHPBB_INSTALLED") ) { @@ -249,7 +209,7 @@ else if ( !empty($HTTP_POST_VARS['send_file']) && $HTTP_POST_VARS['send_file'] = $s_hidden_fields = ''; $s_hidden_fields .= ''; - if( $upgrade == 1 ) + if ( $upgrade == 1 ) { $s_hidden_fields .= ''; } @@ -291,7 +251,10 @@ else if( !empty($HTTP_POST_VARS['ftp_file']) && !defined("PHPBB_INSTALLED") ) // $s_hidden_fields = ''; $s_hidden_fields .= ''; - if( $upgrade == 1 ) + + page_header($lang['NoFTP_config'], "install.$phpEx"); + + if ( $upgrade == 1 ) { $s_hidden_fields .= ''; $s_hidden_fields .= ''; @@ -307,23 +270,15 @@ else if( !empty($HTTP_POST_VARS['ftp_file']) && !defined("PHPBB_INSTALLED") ) $s_hidden_fields .= ''; $s_hidden_fields .= ''; $s_hidden_fields .= ''; + $template->assign_block_vars("switch_upgrade_install", array()); $template->assign_vars(array( "L_UPGRADE_INST" => $lang['continue_upgrade'], "L_UPGRADE_SUBMIT" => $lang['upgrade_submit']) ); } - $template->assign_block_vars("switch_common_install", array()); - - $template->assign_vars(array( - "L_INSTRUCTION_TEXT" => $lang['NoFTP_config'], - "L_SUBMIT" => $lang['Download_config'], - "S_HIDDEN_FIELDS" => $s_hidden_fields, - "S_FORM_ACTION" => "install.$phpEx") - ); - - $template->pparse('body'); + page_footer($lang['Download_config'], $s_hidden_fields); exit; } @@ -347,42 +302,34 @@ else if( !empty($HTTP_POST_VARS['ftp_file']) && !defined("PHPBB_INSTALLED") ) // @ftp_chdir($conn_id, $ftp_dir); - $res = ftp_put($conn_id, 'config.'.$phpEx, $tmpfname, FTP_ASCII); + $res = ftp_put($conn_id, '../config.'.$phpEx, $tmpfname, FTP_ASCII); @ftp_quit($conn_id); unlink($tmpfname); + if( $upgrade == 1 ) { require('upgrade.'.$phpEx); exit; } + // - // Ok we are basically done with the install process let's go on - // and let the user configure their board now. - // - // We are going to do this by calling the admin_board.php from the - // normal board admin section. + // Ok we are basically done with the install process let's go on and let the user + // configure their board now. We are going to do this by calling the admin_board.php + // from the normal board admin section. // $s_hidden_fields = ''; $s_hidden_fields .= ''; $s_hidden_fields .= ''; $s_hidden_fields .= ''; - $template->assign_block_vars("switch_common_install", array()); - - $template->assign_vars(array( - "L_INSTRUCTION_TEXT" => $lang['Inst_Step_2'], - "L_SUBMIT" => $lang['Finish_Install'], - - "S_HIDDEN_FIELDS" => $s_hidden_fields, - "S_FORM_ACTION" => "login.$phpEx") - ); - - $template->pparse('body'); + page_header($lang['Inst_Step_2'], "../login.$phpEx"); + page_footer($lang['Finish_Install'], $s_hidden_fields); exit(); } + } else if ( ( empty($install_step) || $admin_pass1 != $admin_pass2 || empty($admin_pass1) || $dbhost == '' ) && !defined("PHPBB_INSTALLED") ) { @@ -446,81 +393,81 @@ else if ( ( empty($install_step) || $admin_pass1 != $admin_pass2 || empty($admin $s_hidden_fields = ''; - page_header($instruction_text); + page_header($instruction_text, "install.$phpEx"); ?> -
+ | - |