Update to "merge" upgrade with Install... (Not fully tested since current upgrade not in CVS)

git-svn-id: file:///svn/phpbb/trunk@1282 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
the_systech 2001-11-06 16:54:15 +00:00
parent 05fa8e8c22
commit 837dcc4572
3 changed files with 32 additions and 4 deletions

View file

@ -159,6 +159,7 @@ $table_prefix = ( !empty($HTTP_POST_VARS['prefix']) ) ? $HTTP_POST_VARS['prefix'
$ftp_path = ( !empty($HTTP_POST_VARS['ftp_path']) ) ? $HTTP_POST_VARS['ftp_path'] : "";
$ftp_user = ( !empty($HTTP_POST_VARS['ftp_user']) ) ? $HTTP_POST_VARS['ftp_user'] : "";
$ftp_pass = ( !empty($HTTP_POST_VARS['ftp_pass']) ) ? $HTTP_POST_VARS['ftp_pass'] : "";
$upgrade = ( !empty($HTTP_POST_VARS['upgrade']) ) ? $HTTP_POST_VARS['upgrade']: '';
include($phpbb_root_path.'includes/sql_parse.'.$phpEx);
include($phpbb_root_path.'includes/constants.'.$phpEx);
@ -173,6 +174,12 @@ include($phpbb_root_path.'language/lang_' . $language . '/lang_main.'.$phpEx);
$template = new Template($phpbb_root_path . "templates/" . $default_template);
if( $upgrade == 1 )
{
require('upgrade.'.$phpEx);
$install_step = 1;
}
//
// Load default template for install
//
@ -359,6 +366,19 @@ else if( empty($install_step) || $admin_pass1 != $admin_pass2 || $dbhost == "" )
}
$dbms_options .= '</select>';
$upgrade_option = '<select name="upgrade"';
$upgrade_option .= 'onchange="if(this.options[this.selectedIndex].value==1)
{
document.install_form.dbms.selectedIndex=0;
document.install_form.dbms.disabled=1;
}
else
{
document.install_form.dbms.disabled=0;
}">';
$upgrade_option .= '<option value="0">'.$lang['Install'].'</option>';
$upgrade_option .= '<option value="1">'.$lang['Upgrade'].'</option></select>';
$s_hidden_fields = '<input type="hidden" name="install_step" value="1" />';
$template->assign_block_vars("switch_stage_one_install", array());
@ -376,7 +396,7 @@ else if( empty($install_step) || $admin_pass1 != $admin_pass2 || $dbhost == "" )
"L_DB_USER" => $lang['Database'] . ' ' . $lang['Username'],
"L_DB_PASSWORD" => $lang['Database'] . ' ' . $lang['Password'],
"L_DB_PREFIX" => $lang['Table_Prefix'],
"L_UPGRADE" => $lang['Install_Method'],
"L_ADMIN_USERNAME" => $lang['Administrator'] . ' ' . $lang['Username'],
"L_ADMIN_PASSWORD" => $lang['Administrator'] . ' ' . $lang['Password'],
"L_ADMIN_CONFIRM_PASSWORD" => $lang['Confirm'] . ' ' . $lang['Password'],
@ -392,6 +412,7 @@ else if( empty($install_step) || $admin_pass1 != $admin_pass2 || $dbhost == "" )
"S_LANG_SELECT" => $lang_options,
"S_DBMS_SELECT" => $dbms_options,
"S_HIDDEN_FIELDS" => $s_hidden_fields,
"S_UPGRADE_SELECT" => $upgrade_option,
"S_FORM_ACTION" => "install.$phpEx")
);
@ -429,7 +450,7 @@ else
if( $install_step == 1 )
{
if($dbms != 'odbc')
if($dbms != 'odbc' && $upgrade != 1)
{
//
// Ok we have the db info go ahead and read in the relevant schema

View file

@ -1091,6 +1091,9 @@ $lang['ftp_username'] = "Your FTP Username:";
$lang['ftp_password'] = "Your FTP Password:";
$lang['Transfer_config'] = "Start Transfer";
$lang['ftp_info'] = "Enter Your FTP Information";
$lang['Install'] = "Install";
$lang['Upgrade'] = "Upgrade";
$lang['Install_Method'] = 'Choose your installation method';
//
// Ranks admin

View file

@ -116,7 +116,7 @@ a.copyright:hover { color: #000000; text-decoration: underline;}
<td><br /><br /></td>
</tr>
<tr>
<td width="100%"><form action="{S_FORM_ACTION}" method="post"><table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<td width="100%"><form action="{S_FORM_ACTION}" name="install_form" method="post"><table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<!-- BEGIN switch_stage_one_install -->
<tr>
<th colspan="2">{L_INITIAL_CONFIGURATION}</th>
@ -129,6 +129,10 @@ a.copyright:hover { color: #000000; text-decoration: underline;}
<td class="row1" align="right"><span class="gen">{L_DBMS}: </span></td>
<td class="row2">{S_DBMS_SELECT}</td>
</tr>
<tr>
<td class="row1" align="right"><span class="gen">{L_UPGRADE}:</span></td>
<td class="row2">{S_UPGRADE_SELECT}</td>
</tr>
<!-- tr>
<td class="row1" align="right"><span class="gen">{L_DOMAIN_NAME}: </span></td>
<td class="row2"><input type="text" name="cookiedomain" value="{COOKIE_DOMAIN}" /></td>