diff --git a/phpBB/install/install.php b/phpBB/install/install.php index ae742cc6e7..974c8acac4 100644 --- a/phpBB/install/install.php +++ b/phpBB/install/install.php @@ -19,167 +19,26 @@ * ***************************************************************************/ -//error_reporting (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables -error_reporting (E_ERROR | E_WARNING | E_PARSE | E_WARNING); // This will NOT report uninitialized variables +define('IN_PHPBB', true); + +// Error reporting level and runtime escaping +error_reporting (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables set_magic_quotes_runtime(0); // Disable magic_quotes_runtime -if (!get_magic_quotes_gpc()) -{ - $_REQUEST = slash_input_data($_REQUEST); - $_GET = slash_input_data($_GET); - $_POST = slash_input_data($_POST); -} - -define('IN_PHPBB', true); -$phpbb_root_path='./../'; +// Include essential scripts +$phpbb_root_path = './../'; require($phpbb_root_path . 'extension.inc'); require($phpbb_root_path . 'includes/functions.'.$phpEx); - - -// Set some vars -define('ANONYMOUS', 1); -define('ACL_NO', 0); -define('ACL_YES', 1); -define('ACL_UNSET', -1); - -$default_language = 'en'; -$default_template = 'subSilver'; - -$available_dbms = array( - 'firebird' => array( - 'LABEL' => 'FireBird', - 'SCHEMA' => 'firebird', - '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' - ), - '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' => '' - ), - 'mssql-odbc' => array( - 'LABEL' => 'MS SQL Server [ ODBC ]', - 'SCHEMA' => 'mssql', - 'DELIM' => 'GO', - 'DELIM_BASIC' => ';', - 'COMMENTS' => 'remove_comments' - ), - 'postgres' => array( - 'LABEL' => 'PostgreSQL 7.x', - 'SCHEMA' => 'postgres', - 'DELIM' => ';', - 'DELIM_BASIC' => ';', - 'COMMENTS' => 'remove_comments' - ), -); - -// Try and load an appropriate language -if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) -{ - $accept_lang_ary = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); - foreach ($accept_lang_ary as $accept_lang) - { - // Set correct format ... guess full xx_YY form - $accept_lang = substr($accept_lang, 0, 2) . '_' . strtoupper(substr($accept_lang, 3, 2)); - if (file_exists($phpbb_root_path . 'language/' . $accept_lang)) - { - $default_language = $accept_lang; - break; - } - else - { - // No match on xx_YY so try xx - $accept_lang = substr($accept_lang, 0, 2); - if (file_exists($phpbb_root_path . 'language/' . $accept_lang)) - { - $default_language = $accept_lang; - break; - } - } - } -} - -// Obtain various vars -$confirm = (isset($_POST['confirm'])) ? true : false; -$cancel = (isset($_POST['cancel'])) ? true : false; -$install_step = (isset($_REQUEST['install_step'])) ? $_REQUEST['install_step'] : ''; -$upgrade = (!empty($_POST['upgrade'])) ? $_POST['upgrade']: ''; -$upgrade_now = (!empty($_POST['upgrade_now'])) ? $_POST['upgrade_now']:''; - -$language = (!empty($_POST['language'])) ? htmlspecialchars($_POST['language']) : $default_language; -$dbms = isset($_POST['dbms']) ? $_POST['dbms'] : ''; -$dbhost = (!empty($_POST['dbhost'])) ? $_POST['dbhost'] : ''; -$dbuser = (!empty($_POST['dbuser'])) ? $_POST['dbuser'] : ''; -$dbpasswd = (!empty($_POST['dbpasswd'])) ? $_POST['dbpasswd'] : ''; -$dbname = (!empty($_POST['dbname'])) ? $_POST['dbname'] : ''; -$table_prefix = (!empty($_POST['prefix'])) ? $_POST['prefix'] : ''; - -$admin_name = (!empty($_POST['admin_name'])) ? htmlspecialchars($_POST['admin_name']) : ''; -$admin_pass1 = (!empty($_POST['admin_pass1'])) ? htmlspecialchars($_POST['admin_pass1']) : ''; -$admin_pass2 = (!empty($_POST['admin_pass2'])) ? htmlspecialchars($_POST['admin_pass2']) : ''; -$board_email1 = (!empty($_POST['board_email1'])) ? htmlspecialchars($_POST['board_email1']) : ''; -$board_email2 = (!empty($_POST['board_email2'])) ? htmlspecialchars($_POST['board_email2']) : ''; - -$server_name = (!empty($_POST['server_name'])) ? htmlspecialchars($_POST['server_name']) : ''; -$server_port = (!empty($_POST['server_port'])) ? htmlspecialchars($_POST['server_port']) : ''; -$script_path = (!empty($_POST['script_path'])) ? htmlspecialchars($_POST['script_path']) : ''; - -$ftp_path = (!empty($_POST['ftp_path'])) ? $_POST['ftp_path'] : ''; -$ftp_user = (!empty($_POST['ftp_user'])) ? $_POST['ftp_user'] : ''; -$ftp_pass = (!empty($_POST['ftp_pass'])) ? $_POST['ftp_pass'] : ''; - - -// Try opening config file -if (@file_exists('../config.'.$phpEx)) -{ -// include('../config.'.$phpEx); -} - - -// Do we install/upgrade/update or quit back to index? -if (defined('PHPBB_INSTALLED')) -{ -// redirect("../index.$phpEx"); -} - -// Include essential scripts include($phpbb_root_path . 'includes/session.'.$phpEx); include($phpbb_root_path . 'includes/acm/acm_file.'.$phpEx); include($phpbb_root_path . 'includes/functions_admin.'.$phpEx); -// Import language file, setup template ... -include($phpbb_root_path . 'language/' . $language . '/lang_main.'.$phpEx); -include($phpbb_root_path . 'language/' . $language . '/lang_admin.'.$phpEx); - -// If we're upgrading include that script -if ($upgrade) +// Slash data if necessary +if (!get_magic_quotes_gpc()) { - require('upgrade.' . $phpEx); - $install_step = 1; + $_GET = slash_input_data($_GET); + $_POST = slash_input_data($_POST); + $_COOKIE = slash_input_data($_POST); } // Instantiate classes for future use @@ -188,392 +47,1088 @@ $auth = new auth(); $cache = new acm(); -// What shall we do? -if (!empty($_POST['send_file']) && $_POST['send_file'] == 1 && !defined('PHPBB_INSTALLED') && empty($_POST['upgrade_now'])) +// Try opening config file +if (@file_exists($phpbb_root_path . '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 - // if it is on. - $_POST['config_data'] = stripslashes($_POST['config_data']); +// include($phpbb_root_path . 'config.'.$phpEx); - header("Content-Type: text/x-delimtext; name=\"config.$phpEx\""); - header("Content-disposition: attachment; filename=config.$phpEx"); - echo $_POST['config_data']; - exit; - -} -else if (!empty($_POST['send_file']) && $_POST['send_file'] == 2 && !defined("PHPBB_INSTALLED")) -{ - // Ok we couldn't write the config file so let's try ftping it. - $_POST['config_data'] = stripslashes($_POST['config_data']); - - $s_hidden_fields = ''; - $s_hidden_fields .= ''; - - if ($upgrade == 1) + if (defined('PHPBB_INSTALLED')) { - $s_hidden_fields .= ''; +// redirect("../index.$phpEx"); } - - inst_page_header($lang['FTP_INSTRUCTS']); - -?> -
Before proceeding with full installation phpBB will carry out some tests on your server and basic install. Please ensure you read through the results thoroughly and do not proceed until all tests are passed.
+ +You must be running at least PHP 4.1.0 with support for at least one compatible database. If no support modules are shown as available you should contact your hosting provider or review the relevant PHP installation documentation for advice.
+ +• PHP version >= 4.1.0: | +No'; } else { - // Write out a temp file... - $tmpfname = @tempnam('/tmp', 'cfg'); - @unlink($tmpfname); - - $fp = @fopen($tmpfname, 'w'); - @fwrite($fp, $_POST['config_data']); - @fclose($fp); - - // Now ftp it across. - @ftp_chdir($conn_id, $ftp_dir); - $res = @ftp_put($conn_id, 'config.' . $phpEx, $tmpfname, FTP_ASCII); - @ftp_quit($conn_id); - - unlink($tmpfname); - - if ($upgrade) + echo 'Yes'; + if (@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'on') { - require('upgrade.'.$phpEx); - exit; + echo ', safe mode'; } - - $sql = "SELECT * - FROM {$table_prefix}config"; - $result = $db->sql_query($sql); - - $config = array(); - while ($row = $db->sql_fetchrow($result)) - { - $config[$row['config_name']] = $row['config_value']; - } - $db->sql_freeresult($result); - - // Log user in - $auth->login($admin_name, $admin_pass1); - - inst_page_header($lang['INST_STEP_2'], "../adm/index.$phpEx$SID"); - inst_page_footer($lang['FINISH_INSTALL'], $s_hidden_fields); - exit; + echo ''; } + +?> | +
• Supported Databases: | + $available) + { + echo ($i++ > 0) ? '|
lang['DLL_' . $dll]; ?> | ++ |
These modules or applications are optional, you do not need these to use phpBB 2.2. However if you do have them they will will enable greater functionality.
+ +• lang['DLL_' . $dll]; ?>: | ++ |
• Imagemagick support: | +Available, ' . $imagemagick . '' : 'Cannot determine location'; ?> | +
In order to function correctly phpBB needs to be able to access or write to certain files or directories. If you see "Does not exist" you need to create the relevant file or directory. If you see "Not writeable" you need to change the permissions on the file or directory to allow phpBB to write to it.
+ +• | ++ |
These files, directories or permissions are optional. The installation routines will attempt to use various techniques to complete if they do not exist or cannot be written to. However, the presence of these files, directories or permissions will speed installation.
+ +• | ++ |
+ |