|
From: Jonathan H. <the...@us...> - 2001-12-05 21:55:23
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv14273
Modified Files:
install.php
Log Message:
Ok commiting modified install/upgrade integration, but there's still a weird problem I'm working on... I'll post more in the forum..
Index: install.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/install.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** install.php 2001/12/02 23:54:25 1.18
--- install.php 2001/12/05 21:55:20 1.19
***************
*** 91,99 ****
/***************************************************************************
! * Install Customization Section
*
! * This section can be modified to set up some basic default information
* used by the install script. Specifically the default theme data
! * and the default template.
*
**************************************************************************/
--- 91,99 ----
/***************************************************************************
! * Install Customization Section
*
! * This section can be modified to set up some basic default information
* used by the install script. Specifically the default theme data
! * and the default template.
*
**************************************************************************/
***************
*** 208,211 ****
--- 208,213 ----
$upgrade = ( !empty($HTTP_POST_VARS['upgrade']) ) ? $HTTP_POST_VARS['upgrade']: '';
+ $upgrade_now = ( !empty($HTTP_POST_VARS['upgrade_now']) ) ? $HTTP_POST_VARS['upgrade_now']:'';
+
$dbms = isset($HTTP_POST_VARS['dbms']) ? $HTTP_POST_VARS['dbms'] : "";
$language = ( !empty($HTTP_POST_VARS['language']) ) ? $HTTP_POST_VARS['language'] : $default_language;
***************
*** 247,256 ****
$template = new Template($phpbb_root_path . "templates/" . $default_template);
if( $upgrade == 1 )
{
! require('upgrade.'.$phpEx);
$install_step = 1;
}
!
//
// Load default template for install
--- 249,264 ----
$template = new Template($phpbb_root_path . "templates/" . $default_template);
+ //
+ // 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);
$install_step = 1;
}
!
//
// Load default template for install
***************
*** 333,337 ****
//
//
! if( !empty($HTTP_POST_VARS['send_file']) && $HTTP_POST_VARS['send_file'] == 1 && !defined("PHPBB_INSTALLED") )
{
header("Content-Type: text/x-delimtext; name=\"config.php\"");
--- 341,345 ----
//
//
! 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.php\"");
***************
*** 362,366 ****
$template->assign_block_vars("switch_ftp_file", array());
$template->assign_block_vars("switch_common_install", array());
!
$template->assign_vars(array(
"L_INSTRUCTION_TEXT" => $lang['ftp_instructs'],
--- 370,377 ----
$template->assign_block_vars("switch_ftp_file", array());
$template->assign_block_vars("switch_common_install", array());
! if( $upgrade == 1 )
! {
! $s_hidden_fields .= '<input type="hidden" name="upgrade" value="1" />';
! }
$template->assign_vars(array(
"L_INSTRUCTION_TEXT" => $lang['ftp_instructs'],
***************
*** 397,403 ****
$s_hidden_fields = '<input type="hidden" name="config_data" value="' . htmlspecialchars($config_data) . '" />';
$s_hidden_fields .= '<input type="hidden" name="send_file" value="1" />';
!
$template->assign_block_vars("switch_common_install", array());
!
$template->assign_vars(array(
"L_INSTRUCTION_TEXT" => $lang['NoFTP_config'],
--- 408,430 ----
$s_hidden_fields = '<input type="hidden" name="config_data" value="' . htmlspecialchars($config_data) . '" />';
$s_hidden_fields .= '<input type="hidden" name="send_file" value="1" />';
! if( $upgrade == 1 )
! {
! $s_hidden_fields .= '<input type="hidden" name="upgrade" value="1" />';
! $s_hidden_fields .= '<input type="hidden" name="dbms" value="'.$dmbs.'" />';
! $s_hidden_fields .= '<input type="hidden" name="dbhost" value="'.$dbhost.'" />';
! $s_hidden_fields .= '<input type="hidden" name="dbname" value="'.$dbname.'" />';
! $s_hidden_fields .= '<input type="hidden" name="dbuser" value="'.$dbuser.'" />';
! $s_hidden_fields .= '<input type="hidden" name="dbpasswd" value="'.$dbpasswd.'" />';
! $s_hidden_fields .= '<input type="hidden" name="install_step" value="1" />';
! $s_hidden_fields .= '<input type="hidden" name="admin_pass1" value="1" />';
! $s_hidden_fields .= '<input type="hidden" name="admin_pass2" value="1" />';
! $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'],
***************
*** 437,441 ****
unlink($tmpfname);
!
//
// Ok we are basically done with the install process let's go on
--- 464,472 ----
unlink($tmpfname);
! if( $upgrade == 1 )
! {
! require('upgrade.'.$phpEx);
! exit;
! }
//
// Ok we are basically done with the install process let's go on
***************
*** 577,582 ****
$language = $userdata['user_lang'];
}
! else if( isset($dbms) )
{
include($phpbb_root_path.'includes/db.'.$phpEx);
}
--- 608,615 ----
$language = $userdata['user_lang'];
}
! else if( isset($dbms) )
{
+ echo $dbms;
+ exit;
include($phpbb_root_path.'includes/db.'.$phpEx);
}
***************
*** 746,750 ****
}
! if( !$reinstall )
{
$template->assign_block_vars("switch_common_install", array());
--- 779,783 ----
}
! if( !$reinstall && ! $upgrade_now )
{
$template->assign_block_vars("switch_common_install", array());
***************
*** 792,796 ****
--- 825,847 ----
$s_hidden_fields .= '<input type="hidden" name="send_file" value="1" />';
}
+ if( $upgrade == 1 )
+ {
+ $s_hidden_fields .= '<input type="hidden" name="upgrade" value="1" />';
+ $s_hidden_fields .= '<input type="hidden" name="dbms" value="'.$dbms.'" />';
+ $s_hidden_fields .= '<input type="hidden" name="dbhost" value="'.$dbhost.'" />';
+ $s_hidden_fields .= '<input type="hidden" name="dbname" value="'.$dbname.'" />';
+ $s_hidden_fields .= '<input type="hidden" name="dbuser" value="'.$dbuser.'" />';
+ $s_hidden_fields .= '<input type="hidden" name="dbpasswd" value="'.$dbpasswd.'" />';
+ $s_hidden_fields .= '<input type="hidden" name="install_step" value="1" />';
+ $s_hidden_fields .= '<input type="hidden" name="admin_pass1" value="1" />';
+ $s_hidden_fields .= '<input type="hidden" name="admin_pass2" value="1" />';
+ $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_vars(array(
"L_INSTRUCTION_TEXT" => $lang['Unwriteable_config'],
***************
*** 809,812 ****
--- 860,864 ----
@fclose($fp);
+ $upgrade_now = $lang['upgrade_submit'];
}
else
***************
*** 815,818 ****
--- 867,878 ----
}
+ //
+ // First off let's check and see if we are supposed to be doing an upgrade.
+ //
+ if ( $upgrade == 1 && $upgrade_now == $lang['upgrade_submit'] )
+ {
+ require('upgrade.'.$phpEx);
+ exit;
+ }
//
// Ok we are basically done with the install process let's go on
***************
*** 848,850 ****
}
! ?>
\ No newline at end of file
--- 908,910 ----
}
! ?>
|