diff --git a/phpBB/install/install.php b/phpBB/install/install.php
index 35b1373af5..7179f38c84 100644
--- a/phpBB/install/install.php
+++ b/phpBB/install/install.php
@@ -24,12 +24,11 @@ set_magic_quotes_runtime(0); // Disable magic_quotes_runtime
define('IN_PHPBB', true);
$phpbb_root_path='./../';
-require($phpbb_root_path.'extension.inc');
-require($phpbb_root_dir . 'includes/functions_selects.'.$phpEx);
+require($phpbb_root_path . 'extension.inc');
+require($phpbb_root_path . 'includes/functions.'.$phpEx);
$userdata = array();
$lang = array();
-$reinstall = false;
if ( !get_magic_quotes_gpc() )
{
@@ -51,47 +50,47 @@ $default_language = 'english';
$default_template = 'subSilver';
$available_dbms = array(
- "mysql" => array(
- "LABEL" => "MySQL 3.x",
- "SCHEMA" => "mysql",
- "DELIM" => ";",
- "DELIM_BASIC" => ";",
- "COMMENTS" => "remove_remarks"
+ 'mysql' => array(
+ 'LABEL' => 'MySQL 3.x',
+ 'SCHEMA' => 'mysql',
+ 'DELIM' => ';',
+ 'DELIM_BASIC' => ';',
+ 'COMMENTS' => 'remove_remarks'
),
- "mysql4" => array(
- "LABEL" => "MySQL 4.x",
- "SCHEMA" => "mysql",
- "DELIM" => ";",
- "DELIM_BASIC" => ";",
- "COMMENTS" => "remove_remarks"
+ 'mysql4' => array(
+ 'LABEL' => 'MySQL 4.x',
+ 'SCHEMA' => 'mysql',
+ 'DELIM' => ';',
+ 'DELIM_BASIC' => ';',
+ 'COMMENTS' => 'remove_remarks'
),
- "postgres" => array(
- "LABEL" => "PostgreSQL 7.x",
- "SCHEMA" => "postgres",
- "DELIM" => ";",
- "DELIM_BASIC" => ";",
- "COMMENTS" => "remove_comments"
+ 'postgres' => array(
+ 'LABEL' => 'PostgreSQL 7.x',
+ 'SCHEMA' => 'postgres',
+ 'DELIM' => ';',
+ 'DELIM_BASIC' => ';',
+ 'COMMENTS' => 'remove_comments'
),
- "mssql" => array(
- "LABEL" => "MS SQL Server 7/2000",
- "SCHEMA" => "mssql",
- "DELIM" => "GO",
- "DELIM_BASIC" => ";",
- "COMMENTS" => "remove_comments"
+ 'mssql' => array(
+ 'LABEL' => 'MS SQL Server 7/2000',
+ 'SCHEMA' => 'mssql',
+ 'DELIM' => 'GO',
+ 'DELIM_BASIC' => ';',
+ 'COMMENTS' => 'remove_comments'
),
- "msaccess" => array(
- "LABEL" => "MS Access [ ODBC ]",
- "SCHEMA" => "",
- "DELIM" => "",
- "DELIM_BASIC" => ";",
- "COMMENTS" => ""
+ 'msaccess' => array(
+ 'LABEL' => 'MS Access [ ODBC ]',
+ 'SCHEMA' => '',
+ 'DELIM' => '',
+ 'DELIM_BASIC' => ';',
+ 'COMMENTS' => ''
),
- "mssql-odbc" => array(
- "LABEL" => "MS SQL Server [ ODBC ]",
- "SCHEMA" => "mssql",
- "DELIM" => "GO",
- "DELIM_BASIC" => ";",
- "COMMENTS" => "remove_comments"
+ 'mssql-odbc' => array(
+ 'LABEL' => 'MS SQL Server [ ODBC ]',
+ 'SCHEMA' => 'mssql',
+ 'DELIM' => 'GO',
+ 'DELIM_BASIC' => ';',
+ 'COMMENTS' => 'remove_comments'
)
);
@@ -152,149 +151,78 @@ if( isset($HTTP_POST_VARS['install_step']) || isset($HTTP_GET_VARS['install_step
}
else
{
- $install_step = "";
+ $install_step = '';
}
$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'] : "";
+$dbms = isset($HTTP_POST_VARS['dbms']) ? $HTTP_POST_VARS['dbms'] : '';
$language = ( !empty($HTTP_POST_VARS['language']) ) ? $HTTP_POST_VARS['language'] : $default_language;
-$dbhost = ( !empty($HTTP_POST_VARS['dbhost']) ) ? $HTTP_POST_VARS['dbhost'] : "";
-$dbuser = ( !empty($HTTP_POST_VARS['dbuser']) ) ? $HTTP_POST_VARS['dbuser'] : "";
-$dbpasswd = ( !empty($HTTP_POST_VARS['dbpasswd']) ) ? $HTTP_POST_VARS['dbpasswd'] : "";
-$dbname = ( !empty($HTTP_POST_VARS['dbname']) ) ? $HTTP_POST_VARS['dbname'] : "";
+$dbhost = ( !empty($HTTP_POST_VARS['dbhost']) ) ? $HTTP_POST_VARS['dbhost'] : '';
+$dbuser = ( !empty($HTTP_POST_VARS['dbuser']) ) ? $HTTP_POST_VARS['dbuser'] : '';
+$dbpasswd = ( !empty($HTTP_POST_VARS['dbpasswd']) ) ? $HTTP_POST_VARS['dbpasswd'] : '';
+$dbname = ( !empty($HTTP_POST_VARS['dbname']) ) ? $HTTP_POST_VARS['dbname'] : '';
-$table_prefix = ( !empty($HTTP_POST_VARS['prefix']) ) ? $HTTP_POST_VARS['prefix'] : "";
+$table_prefix = ( !empty($HTTP_POST_VARS['prefix']) ) ? $HTTP_POST_VARS['prefix'] : '';
-$admin_name = ( !empty($HTTP_POST_VARS['admin_name']) ) ? $HTTP_POST_VARS['admin_name'] : "";
-$admin_pass1 = ( !empty($HTTP_POST_VARS['admin_pass1']) ) ? $HTTP_POST_VARS['admin_pass1'] : "";
-$admin_pass2 = ( !empty($HTTP_POST_VARS['admin_pass2']) ) ? $HTTP_POST_VARS['admin_pass2'] : "";
+$admin_name = ( !empty($HTTP_POST_VARS['admin_name']) ) ? $HTTP_POST_VARS['admin_name'] : '';
+$admin_pass1 = ( !empty($HTTP_POST_VARS['admin_pass1']) ) ? $HTTP_POST_VARS['admin_pass1'] : '';
+$admin_pass2 = ( !empty($HTTP_POST_VARS['admin_pass2']) ) ? $HTTP_POST_VARS['admin_pass2'] : '';
-$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'] : "";
+$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'] : '';
-$server_name = ( !empty($HTTP_POST_VARS['server_name']) ) ? $HTTP_POST_VARS['server_name'] : "";
-$server_port = ( !empty($HTTP_POST_VARS['server_port']) ) ? $HTTP_POST_VARS['server_port'] : "";
-$board_email = ( !empty($HTTP_POST_VARS['board_email']) ) ? $HTTP_POST_VARS['board_email'] : "";
-$script_path = ( !empty($HTTP_POST_VARS['script_path']) ) ? $HTTP_POST_VARS['script_path'] : "";
+$server_name = ( !empty($HTTP_POST_VARS['server_name']) ) ? $HTTP_POST_VARS['server_name'] : '';
+$server_port = ( !empty($HTTP_POST_VARS['server_port']) ) ? $HTTP_POST_VARS['server_port'] : '';
+$board_email = ( !empty($HTTP_POST_VARS['board_email']) ) ? $HTTP_POST_VARS['board_email'] : '';
+$script_path = ( !empty($HTTP_POST_VARS['script_path']) ) ? $HTTP_POST_VARS['script_path'] : '';
-if( @file_exists('config.'.$phpEx) )
+//
+//
+//
+if ( @file_exists('../config.'.$phpEx) )
{
- include('config.'.$phpEx);
+ include('../config.'.$phpEx);
}
-if( !defined("PHPBB_INSTALLED") )
+//
+//
+//
+if ( !defined('PHPBB_INSTALLED') )
{
- include($phpbb_root_path.'includes/sql_parse.'.$phpEx);
- include($phpbb_root_path.'includes/constants.'.$phpEx);
- include($phpbb_root_path.'includes/template.'.$phpEx);
- include($phpbb_root_path.'includes/functions.'.$phpEx);
- include($phpbb_root_path.'includes/sessions.'.$phpEx);
+ include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
+ include($phpbb_root_path . 'includes/session.'.$phpEx);
//
// Import language file, setup template ...
//
- include($phpbb_root_path.'language/lang_' . $language . '/lang_main.'.$phpEx);
- include($phpbb_root_path.'language/lang_' . $language . '/lang_admin.'.$phpEx);
-
- $template = new Template($phpbb_root_path . "templates/" . $default_template);
+ 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 )
+ if ( $upgrade == 1 )
{
// require('upgrade.'.$phpEx);
$install_step = 1;
}
-
- //
- // Load default template for install
- //
- $template->set_filenames(array(
- "body" => "install.tpl")
- );
-
- $template->assign_vars(array(
- "L_INSTALLATION" => $lang['Welcome_install'])
- );
}
else
{
- define("IN_ADMIN", 1);
-
- include($phpbb_root_path.'common.'.$phpEx);
- include($phpbb_root_path.'includes/sql_parse.'.$phpEx);
-
- //
- // Set page ID for session management
- //
- $userdata = session_pagestart($user_ip, PAGE_INDEX, $session_length);
- init_userprefs($userdata);
- //
- // End session management
- //
-
- if( $userdata['user_level'] == ADMIN && !$cancel && $dbms != 'msaccess' )
- {
- if( !$confirm )
- {
- //
- // Sorry this has already been installed can't do anything more with it
- //
- include($phpbb_root_path . 'includes/page_header.'.$phpEx);
-
- $template->set_filenames(array(
- "confirm" => "confirm_body.tpl")
- );
-
- $template->assign_vars(array(
- "MESSAGE_TITLE" => $lang['Admin_config'],
- "MESSAGE_TEXT" => $lang['Re_install'],
-
- "L_YES" => $lang['Yes'],
- "L_NO" => $lang['No'],
-
- "S_CONFIRM_ACTION" => append_sid("install.$phpEx"),
- "S_HIDDEN_FIELDS" => $hidden_fields)
- );
-
- $template->pparse("confirm");
-
- include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
- }
-
- include($phpbb_root_path.'language/lang_' . $language . '/lang_main.'.$phpEx);
- include($phpbb_root_path.'language/lang_' . $language . '/lang_admin.'.$phpEx);
-
- $template = new Template($phpbb_root_path . "templates/" . $default_template);
-
- $template->set_filenames(array(
- "body" => "install.tpl")
- );
-
- $template->assign_vars(array(
- "L_INSTALLATION" => $lang['Welcome_install'])
- );
-
- $reinstall = true;
- }
- else
- {
- header("Location: " . append_sid("index.$phpEx", true));
- }
+ header("Location: ../index.$phpEx");
+ exit;
}
//
//
//
-if( !empty($HTTP_POST_VARS['send_file']) && $HTTP_POST_VARS['send_file'] == 1 && !defined("PHPBB_INSTALLED") && empty($HTTP_POST_VARS['upgrade_now']) )
+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");
@@ -310,7 +238,7 @@ if( !empty($HTTP_POST_VARS['send_file']) && $HTTP_POST_VARS['send_file'] == 1 &
exit;
}
-else if( !empty($HTTP_POST_VARS['send_file']) && $HTTP_POST_VARS['send_file'] == 2 && !defined("PHPBB_INSTALLED") )
+else if ( !empty($HTTP_POST_VARS['send_file']) && $HTTP_POST_VARS['send_file'] == 2 && !defined("PHPBB_INSTALLED") )
{
//
// Ok we couldn't write the config file so let's try ftping it.
@@ -356,7 +284,7 @@ else if( !empty($HTTP_POST_VARS['ftp_file']) && !defined("PHPBB_INSTALLED") )
$conn_id = @ftp_connect('localhost');
$login_result = @ftp_login($conn_id, "$ftp_user", "$ftp_pass");
- if( !$conn_id || !$login_result )
+ if ( !$conn_id || !$login_result )
{
//
// Error couldn't get connected... Go back to option to send file...
@@ -456,13 +384,12 @@ else if( !empty($HTTP_POST_VARS['ftp_file']) && !defined("PHPBB_INSTALLED") )
exit();
}
}
-else if( ( empty($install_step) || $admin_pass1 != $admin_pass2 || empty($admin_pass1) || $dbhost == "" ) && !defined("PHPBB_INSTALLED") )
-{ //
+else if ( ( empty($install_step) || $admin_pass1 != $admin_pass2 || empty($admin_pass1) || $dbhost == '' ) && !defined("PHPBB_INSTALLED") )
+{
+ //
// Ok we haven't installed before so lets work our way through the various
// steps of the install process. This could turn out to be quite a lengty
// process.
- //
-
//
// Step 0 gather the pertinant info for database setup...
// Namely dbms, dbhost, dbname, dbuser, and dbpasswd.
@@ -471,7 +398,6 @@ else if( ( empty($install_step) || $admin_pass1 != $admin_pass2 || empty($admin_
//
// Guess at some basic info used for install..
//
-
if ( !empty($HTTP_SERVER_VARS['SERVER_NAME']) || !empty($HTTP_ENV_VARS['SERVER_NAME']) )
{
$server_name = ( !empty($HTTP_SERVER_VARS['SERVER_NAME']) ) ? $HTTP_SERVER_VARS['SERVER_NAME'] : $HTTP_ENV_VARS['SERVER_NAME'];
@@ -484,6 +410,7 @@ else if( ( empty($install_step) || $admin_pass1 != $admin_pass2 || empty($admin_
{
$server_name = '';
}
+
if ( !empty($HTTP_SERVER_VARS['SERVER_PORT']) || !empty($HTTP_ENV_VARS['SERVER_PORT']) )
{
$server_port = ( !empty($HTTP_SERVER_VARS['SERVER_PORT']) ) ? $HTTP_SERVER_VARS['SERVER_PORT'] : $HTTP_ENV_VARS['SERVER_PORT'];
@@ -492,74 +419,108 @@ else if( ( empty($install_step) || $admin_pass1 != $admin_pass2 || empty($admin_
{
$server_port = '80';
}
- $script_path = preg_replace('/install\.'.$phpEx.'/i', '', $HTTP_SERVER_VARS['PHP_SELF']);
+ $script_path = preg_replace('/install\/install\.'.$phpEx.'/i', '', $HTTP_SERVER_VARS['PHP_SELF']);
+
+ //
+ //
+ //
$instruction_text = $lang['Inst_Step_0'];
-
- if( (($HTTP_POST_VARS['admin_pass1'] != $HTTP_POST_VARS['admin_pass2']) && $install_step != '0') || (empty($HTTP_POST_VARS['admin_pass1']) && !empty($dbhost)))
+/*
+ if ( (($HTTP_POST_VARS['admin_pass1'] != $HTTP_POST_VARS['admin_pass2']) && $install_step != '0') || ( empty($HTTP_POST_VARS['admin_pass1']) && !empty($dbhost)) )
{
$instruction_text = $lang['Password_mismatch'] . '
' . $instruction_text;
}
+*/
+ $lang_options = language_select($language, 'language', '../language');
- $lang_options = language_select($language, 'language');
-
- $dbms_options = '';
- $upgrade_option = '';
+ $upgrade_option = '';
+ $upgrade_option .= '';
+ $upgrade_option .= '';
$s_hidden_fields = '';
- $template->assign_block_vars("switch_stage_one_install", array());
- $template->assign_block_vars("switch_common_install", array());
+ page_header($instruction_text);
- $template->assign_vars(array(
- "L_INSTRUCTION_TEXT" => $instruction_text,
- "L_INITIAL_CONFIGURATION" => $lang['Initial_config'],
- "L_DATABASE_CONFIGURATION" => $lang['DB_config'],
- "L_ADMIN_CONFIGURATION" => $lang['Admin_config'],
- "L_LANGUAGE" => $lang['Default_lang'],
- "L_DBMS" => $lang['dbms'],
- "L_DB_HOST" => $lang['DB_Host'],
- "L_DB_NAME" => $lang['DB_Name'],
- "L_DB_USER" => $lang['DB_Username'],
- "L_DB_PASSWORD" => $lang['DB_Password'],
- "L_DB_PREFIX" => $lang['Table_Prefix'],
- "L_UPGRADE" => $lang['Install_Method'],
- "L_ADMIN_USERNAME" => $lang['Admin_Username'],
- "L_ADMIN_PASSWORD" => $lang['Admin_Password'],
- "L_ADMIN_CONFIRM_PASSWORD" => $lang['Admin_Password_confirm'],
- "L_SUBMIT" => $lang['Start_Install'],
- "L_ADMIN_EMAIL" => $lang['Admin_email'],
- "L_SERVER_NAME" => $lang['Server_name'],
- "L_SERVER_PORT" => $lang['Server_port'],
- "L_SCRIPT_PATH" => $lang['Script_path'],
-
- "SCRIPT_PATH" => $script_path,
- "SERVER_PORT" => $server_port,
- "SERVER_NAME" => $server_name,
- "DB_PREFIX" => ( !empty($table_prefix) ) ? $table_prefix : "phpbb_",
- "DB_HOST" => ( $dbhost != "" ) ? $dbhost : "",
- "DB_USER" => ( $dbuser != "" ) ? $dbuser : "",
- "DB_PASSWD" => ( $dbpasswd != "" ) ? $dbpasswd : "",
- "ADMIN_USERNAME" => ( $admin_name != "" ) ? $admin_name : "",
+?>
+
![]() |
+ + |
+ + + + + + Powered by phpBB © 2002 phpBB Group
+
++ + + + \ No newline at end of file |