diff --git a/phpBB/admin/admin_ban.php b/phpBB/admin/admin_ban.php index 40232d7098..fa672a935a 100644 --- a/phpBB/admin/admin_ban.php +++ b/phpBB/admin/admin_ban.php @@ -304,7 +304,7 @@ if ( isset($_POST['bansubmit']) ) add_admin_log('log_ban_' . $mode, $ban_reason, $ban_list_log); } - $message = $lang['Ban_update_sucessful'] . '

' . sprintf($lang['Click_return_banadmin'], '', '') . '

' . sprintf($lang['Click_return_admin_index'], '', ''); + $message = $user->lang['Ban_update_sucessful'] . '

' . sprintf($user->lang['Click_return_banadmin'], '', '') . '

' . sprintf($user->lang['Click_return_admin_index'], '', ''); message_die(MESSAGE, $message); } @@ -325,7 +325,7 @@ else if ( isset($_POST['unbansubmit']) ) add_admin_log('log_unban_' . $mode, sizeof($_POST['unban'])); } - message_die(MESSAGE, $lang['Ban_update_sucessful']); + message_die(MESSAGE, $user->lang['Ban_update_sucessful']); } // @@ -343,7 +343,7 @@ $db->sql_query($sql); // // Ban length options // -$ban_end_text = array(0 => $lang['Permanent'], 30 => $lang['30_Mins'], 60 => $lang['1_Hour'], 360 => $lang['6_Hours'], 1440 => $lang['1_Day'], 10080 => $lang['7_Days'], 20160 => $lang['2_Weeks'], 40320 => $lang['1_Month'], -1 => $lang['Other']); +$ban_end_text = array(0 => $user->lang['Permanent'], 30 => $user->lang['30_Mins'], 60 => $user->lang['1_Hour'], 360 => $user->lang['6_Hours'], 1440 => $user->lang['1_Day'], 10080 => $user->lang['7_Days'], 20160 => $user->lang['2_Weeks'], 40320 => $user->lang['1_Month'], -1 => $user->lang['Other']); $ban_end_options = ''; foreach ( $ban_end_text as $length => $text ) @@ -357,13 +357,13 @@ foreach ( $ban_end_text as $length => $text ) switch ( $mode ) { case 'user': - $l_title = $lang['Ban_users']; + $l_title = $user->lang['Ban_users']; break; case 'email': - $l_title = $lang['Ban_emails']; + $l_title = $user->lang['Ban_emails']; break; case 'ip': - $l_title = $lang['Ban_ips']; + $l_title = $user->lang['Ban_ips']; break; } @@ -374,7 +374,7 @@ page_header($l_title); ?> -

+

lang['Ban_explain']; ?>

sql_freeresult($result); - $l_ban_title = $lang['Ban_users']; - $l_ban_explain = $lang['Ban_username_explain']; - $l_unban_title = $lang['Unban_username']; - $l_unban_explain = $lang['Unban_username_explain']; - $l_ban_cell = $lang['Username']; - $l_no_ban_cell = $lang['No_banned_users']; - $s_submit_extra = ''; + $l_ban_title = $user->lang['Ban_users']; + $l_ban_explain = $user->lang['Ban_username_explain']; + $l_unban_title = $user->lang['Unban_username']; + $l_unban_explain = $user->lang['Unban_username_explain']; + $l_ban_cell = $user->lang['Username']; + $l_no_ban_cell = $user->lang['No_banned_users']; + $s_submit_extra = ''; break; @@ -440,12 +440,12 @@ switch ( $mode ) } $db->sql_freeresult($result); - $l_ban_title = $lang['Ban_ips']; - $l_ban_explain = $lang['Ban_IP_explain']; - $l_unban_title = $lang['Unban_IP']; - $l_unban_explain = $lang['Unban_IP_explain']; - $l_ban_cell = $lang['IP_hostname']; - $l_no_ban_cell = $lang['No_banned_ip']; + $l_ban_title = $user->lang['Ban_ips']; + $l_ban_explain = $user->lang['Ban_IP_explain']; + $l_unban_title = $user->lang['Unban_IP']; + $l_unban_explain = $user->lang['Unban_IP_explain']; + $l_ban_cell = $user->lang['IP_hostname']; + $l_no_ban_cell = $user->lang['No_banned_ip']; $s_submit_extra = ''; break; @@ -474,12 +474,12 @@ switch ( $mode ) } $db->sql_freeresult($result); - $l_ban_title = $lang['Ban_emails']; - $l_ban_explain = $lang['Ban_email_explain']; - $l_unban_title = $lang['Unban_email']; - $l_unban_explain = $lang['Unban_email_explain']; - $l_ban_cell = $lang['Email_address']; - $l_no_ban_cell = $lang['No_banned_email']; + $l_ban_title = $user->lang['Ban_emails']; + $l_ban_explain = $user->lang['Ban_email_explain']; + $l_unban_title = $user->lang['Unban_email']; + $l_unban_explain = $user->lang['Unban_email_explain']; + $l_ban_cell = $user->lang['Email_address']; + $l_no_ban_cell = $user->lang['No_banned_email']; $s_submit_extra = ''; break; @@ -507,15 +507,15 @@ switch ( $mode ) - : + lang['Ban_length']; ?>:   - : + lang['Ban_reason']; ?>: -     +     @@ -551,7 +551,7 @@ switch ( $mode ) ?> - + diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 3b4f5df354..18bd69f4ea 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -24,7 +24,7 @@ class session var $session_id = ''; var $data = array(); var $browser = ''; - var $user_ip = ''; + var $ip = ''; var $page = ''; var $load; @@ -388,6 +388,7 @@ class user extends session { include($this->lang_path . 'lang_admin.' . $phpEx); } + $this->lang = &$lang; /* if ( is_array($lang_set) ) @@ -759,7 +760,7 @@ class auth // Authentication plug-ins is largely down to Sergey Kanareykin, our thanks to him. function login($username, $password, $autologin = false) { - global $board_config, $session, $phpEx; + global $board_config, $user, $phpEx; $method = trim($board_config['auth_method']); @@ -770,14 +771,13 @@ class auth $method = 'login_' . $method; if ( function_exists($method) ) { - if ( !($user = $method($username, $password)) ) + if ( !($login = $method($username, $password)) ) { return false; } $autologin = ( isset($autologin) ) ? md5($password) : ''; - - return ( $user['user_active'] ) ? $session->create($user['user_id'], $autologin) : false; + return ( $login['user_active'] ) ? $user->create($login['user_id'], $autologin) : false; } } diff --git a/phpBB/install/install.php b/phpBB/install/install.php index 77ff02f128..d748aa0c25 100644 --- a/phpBB/install/install.php +++ b/phpBB/install/install.php @@ -32,9 +32,8 @@ $lang = array(); if ( !get_magic_quotes_gpc() ) { - $HTTP_GET_VARS = slash_input_data($HTTP_GET_VARS); - $HTTP_POST_VARS = slash_input_data($HTTP_POST_VARS); - $HTTP_COOKIE_VARS = slash_input_data($HTTP_COOKIE_VARS); + $_GET = slash_input_data($_GET); + $_POST = slash_input_data($_POST); } /*************************************************************************** @@ -45,49 +44,74 @@ if ( !get_magic_quotes_gpc() ) * and the default template. * **************************************************************************/ +$default_language = 'en'; + +if ( isset($_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; + } + } + } +} -$default_language = 'english'; $default_template = 'subSilver'; $available_dbms = array( 'mysql' => array( 'LABEL' => 'MySQL 3.x', - 'SCHEMA' => 'mysql', + 'SCHEMA' => 'mysql', 'DELIM' => ';', 'DELIM_BASIC' => ';', 'COMMENTS' => 'remove_remarks' - ), + ), 'mysql4' => array( 'LABEL' => 'MySQL 4.x', - 'SCHEMA' => 'mysql', - 'DELIM' => ';', + 'SCHEMA' => 'mysql', + 'DELIM' => ';', 'DELIM_BASIC' => ';', 'COMMENTS' => 'remove_remarks' - ), + ), 'postgres' => array( 'LABEL' => 'PostgreSQL 7.x', - 'SCHEMA' => 'postgres', - 'DELIM' => ';', + 'SCHEMA' => 'postgres', + 'DELIM' => ';', 'DELIM_BASIC' => ';', 'COMMENTS' => 'remove_comments' - ), + ), 'mssql' => array( 'LABEL' => 'MS SQL Server 7/2000', - 'SCHEMA' => 'mssql', - 'DELIM' => 'GO', + 'SCHEMA' => 'mssql', + 'DELIM' => 'GO', 'DELIM_BASIC' => ';', 'COMMENTS' => 'remove_comments' ), 'msaccess' => array( 'LABEL' => 'MS Access [ ODBC ]', - 'SCHEMA' => '', - 'DELIM' => '', + 'SCHEMA' => '', + 'DELIM' => '', 'DELIM_BASIC' => ';', 'COMMENTS' => '' ), 'mssql-odbc' => array( 'LABEL' => 'MS SQL Server [ ODBC ]', - 'SCHEMA' => 'mssql', + 'SCHEMA' => 'mssql', 'DELIM' => 'GO', 'DELIM_BASIC' => ';', 'COMMENTS' => 'remove_comments' @@ -100,7 +124,7 @@ $available_dbms = array( // define('NO_FTP', true); /*************************************************************************** -* +* * End Install Customization Section * ***************************************************************************/ @@ -116,57 +140,55 @@ if ( @file_exists('../config.'.$phpEx) ) // // Obtain various vars // -$confirm = ( isset($HTTP_POST_VARS['confirm']) ) ? true : false; -$cancel = ( isset($HTTP_POST_VARS['cancel']) ) ? true : false; +$confirm = ( isset($_POST['confirm']) ) ? true : false; +$cancel = ( isset($_POST['cancel']) ) ? true : false; -if ( isset($HTTP_POST_VARS['install_step']) || isset($HTTP_GET_VARS['install_step']) ) +if ( isset($_POST['install_step']) || isset($_GET['install_step']) ) { - $install_step = ( isset($HTTP_POST_VARS['install_step']) ) ? $HTTP_POST_VARS['install_step'] : $HTTP_GET_VARS['install_step']; + $install_step = ( isset($_POST['install_step']) ) ? $_POST['install_step'] : $_GET['install_step']; } else { $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']:''; +$upgrade = ( !empty($_POST['upgrade']) ) ? $_POST['upgrade']: ''; +$upgrade_now = ( !empty($_POST['upgrade_now']) ) ? $_POST['upgrade_now']:''; -$dbms = isset($HTTP_POST_VARS['dbms']) ? $HTTP_POST_VARS['dbms'] : ''; -$language = ( !empty($HTTP_POST_VARS['language']) ) ? $HTTP_POST_VARS['language'] : $default_language; +$dbms = isset($_POST['dbms']) ? $_POST['dbms'] : ''; +$language = ( !empty($_POST['language']) ) ? $_POST['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($_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($HTTP_POST_VARS['prefix']) ) ? $HTTP_POST_VARS['prefix'] : ''; +$table_prefix = ( !empty($_POST['prefix']) ) ? $_POST['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($_POST['admin_name']) ) ? $_POST['admin_name'] : ''; +$admin_pass1 = ( !empty($_POST['admin_pass1']) ) ? $_POST['admin_pass1'] : ''; +$admin_pass2 = ( !empty($_POST['admin_pass2']) ) ? $_POST['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($_POST['ftp_path']) ) ? $_POST['ftp_path'] : ''; +$ftp_user = ( !empty($_POST['ftp_user']) ) ? $_POST['ftp_user'] : ''; +$ftp_pass = ( !empty($_POST['ftp_pass']) ) ? $_POST['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($_POST['server_name']) ) ? $_POST['server_name'] : ''; +$server_port = ( !empty($_POST['server_port']) ) ? $_POST['server_port'] : ''; +$board_email = ( !empty($_POST['board_email']) ) ? $_POST['board_email'] : ''; +$script_path = ( !empty($_POST['script_path']) ) ? $_POST['script_path'] : ''; // // Do we install/upgrade/update or quit back to index? // if ( !defined('PHPBB_INSTALLED') ) { - include($phpbb_root_path . 'includes/functions_admin.'.$phpEx); include($phpbb_root_path . 'includes/session.'.$phpEx); + include($phpbb_root_path . 'includes/functions_admin.'.$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); + include($phpbb_root_path . 'language/' . $language . '/lang_main.'.$phpEx); + include($phpbb_root_path . 'language/' . $language . '/lang_admin.'.$phpEx); if ( $upgrade == 1 ) { @@ -183,30 +205,30 @@ 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']) ) +if ( !empty($_POST['send_file']) && $_POST['send_file'] == 1 && !defined("PHPBB_INSTALLED") && empty($_POST['upgrade_now']) ) { // // 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 + // because we add slahes at the top if its off, and they are added automaticlly // if it is on. // - $HTTP_POST_VARS['config_data'] = stripslashes($HTTP_POST_VARS['config_data']); + $_POST['config_data'] = stripslashes($_POST['config_data']); header("Content-Type: text/x-delimtext; name=\"config.$phpEx\""); header("Content-disposition: attachment; filename=config.$phpEx"); - echo $HTTP_POST_VARS['config_data']; + echo $_POST['config_data']; exit; } -else if ( !empty($HTTP_POST_VARS['send_file']) && $HTTP_POST_VARS['send_file'] == 2 && !defined("PHPBB_INSTALLED") ) +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. // - $HTTP_POST_VARS['config_data'] = stripslashes($HTTP_POST_VARS['config_data']); + $_POST['config_data'] = stripslashes($_POST['config_data']); - $s_hidden_fields = ''; + $s_hidden_fields = ''; $s_hidden_fields .= ''; if ( $upgrade == 1 ) @@ -225,7 +247,7 @@ else if ( !empty($HTTP_POST_VARS['send_file']) && $HTTP_POST_VARS['send_file'] = "L_FTP_USER" => $lang['ftp_username'], "L_SUBMIT" => $lang['Transfer_config'], - "S_HIDDEN_FIELDS" => $s_hidden_fields, + "S_HIDDEN_FIELDS" => $s_hidden_fields, "S_FORM_ACTION" => "install.$phpEx") ); @@ -234,13 +256,13 @@ else if ( !empty($HTTP_POST_VARS['send_file']) && $HTTP_POST_VARS['send_file'] = exit; } -else if( !empty($HTTP_POST_VARS['ftp_file']) && !defined("PHPBB_INSTALLED") ) +else if( !empty($_POST['ftp_file']) && !defined("PHPBB_INSTALLED") ) { // // Here we'll actually send the file... // - $HTTP_POST_VARS['config_data'] = stripslashes($HTTP_POST_VARS['config_data']); - + $_POST['config_data'] = stripslashes($_POST['config_data']); + $conn_id = @ftp_connect('localhost'); $login_result = @ftp_login($conn_id, "$ftp_user", "$ftp_pass"); @@ -249,7 +271,7 @@ else if( !empty($HTTP_POST_VARS['ftp_file']) && !defined("PHPBB_INSTALLED") ) // // Error couldn't get connected... Go back to option to send file... // - $s_hidden_fields = ''; + $s_hidden_fields = ''; $s_hidden_fields .= ''; page_header($lang['NoFTP_config'], "install.$phpEx"); @@ -293,7 +315,7 @@ else if( !empty($HTTP_POST_VARS['ftp_file']) && !defined("PHPBB_INSTALLED") ) $fp = @fopen($tmpfname, 'w'); - @fwrite($fp, $HTTP_POST_VARS['config_data']); + @fwrite($fp, $_POST['config_data']); @fclose($fp); @@ -308,7 +330,7 @@ else if( !empty($HTTP_POST_VARS['ftp_file']) && !defined("PHPBB_INSTALLED") ) unlink($tmpfname); - if( $upgrade == 1 ) + if( $upgrade == 1 ) { require('upgrade.'.$phpEx); exit; @@ -335,7 +357,7 @@ else if ( ( empty($install_step) || $admin_pass1 != $admin_pass2 || empty($admin { // // 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 + // steps of the install process. This could turn out to be quite a lengty // process. // // Step 0 gather the pertinant info for database setup... @@ -345,36 +367,36 @@ 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']) ) + if ( !empty($_SERVER['SERVER_NAME']) || !empty($_ENV['SERVER_NAME']) ) { - $server_name = ( !empty($HTTP_SERVER_VARS['SERVER_NAME']) ) ? $HTTP_SERVER_VARS['SERVER_NAME'] : $HTTP_ENV_VARS['SERVER_NAME']; + $server_name = ( !empty($_SERVER['SERVER_NAME']) ) ? $_SERVER['SERVER_NAME'] : $_ENV['SERVER_NAME']; } - else if ( !empty($HTTP_SERVER_VARS['HTTP_HOST']) || !empty($HTTP_ENV_VARS['HTTP_HOST']) ) + else if ( !empty($_SERVER['HTTP_HOST']) || !empty($_ENV['HTTP_HOST']) ) { - $server_name = ( !empty($HTTP_SERVER_VARS['HTTP_HOST']) ) ? $HTTP_SERVER_VARS['HTTP_HOST'] : $HTTP_ENV_VARS['HTTP_HOST']; + $server_name = ( !empty($_SERVER['HTTP_HOST']) ) ? $_SERVER['HTTP_HOST'] : $_ENV['HTTP_HOST']; } else { $server_name = ''; } - if ( !empty($HTTP_SERVER_VARS['SERVER_PORT']) || !empty($HTTP_ENV_VARS['SERVER_PORT']) ) + if ( !empty($_SERVER['SERVER_PORT']) || !empty($_ENV['SERVER_PORT']) ) { - $server_port = ( !empty($HTTP_SERVER_VARS['SERVER_PORT']) ) ? $HTTP_SERVER_VARS['SERVER_PORT'] : $HTTP_ENV_VARS['SERVER_PORT']; + $server_port = ( !empty($_SERVER['SERVER_PORT']) ) ? $_SERVER['SERVER_PORT'] : $_ENV['SERVER_PORT']; } else { $server_port = '80'; } - $script_path = preg_replace('/install\/install\.'.$phpEx.'/i', '', $HTTP_SERVER_VARS['PHP_SELF']); + $script_path = preg_replace('/install\/install\.'.$phpEx.'/i', '', $_SERVER['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 ( (($_POST['admin_pass1'] != $_POST['admin_pass2']) && $install_step != '0') || ( empty($_POST['admin_pass1']) && !empty($dbhost)) ) { $instruction_text = $lang['Password_mismatch'] . '
' . $instruction_text; } @@ -390,7 +412,7 @@ else if ( ( empty($install_step) || $admin_pass1 != $admin_pass2 || empty($admin $upgrade_option = ''; $upgrade_option .= ''; $upgrade_option .= ''; - + $s_hidden_fields = ''; page_header($instruction_text, "install.$phpEx"); @@ -440,7 +462,7 @@ else if ( ( empty($install_step) || $admin_pass1 != $admin_pass2 || empty($admin : - + : @@ -456,7 +478,7 @@ else if ( ( empty($install_step) || $admin_pass1 != $admin_pass2 || empty($admin : - + : @@ -505,7 +527,7 @@ else } if ( !extension_loaded( $check_exts ) && !extension_loaded( $check_other ) ) - { + { /* $template->assign_block_vars("switch_error_install", array()); $template->assign_vars(array( @@ -526,8 +548,8 @@ else $dbms_basic = 'schemas/' . $available_dbms[$dbms]['SCHEMA'] . '_basic.sql'; $remove_remarks = $available_dbms[$dbms]['COMMENTS'];; - $delimiter = $available_dbms[$dbms]['DELIM']; - $delimiter_basic = $available_dbms[$dbms]['DELIM_BASIC']; + $delimiter = $available_dbms[$dbms]['DELIM']; + $delimiter_basic = $available_dbms[$dbms]['DELIM_BASIC']; if ( $install_step == 1 || $reinstall ) { @@ -553,7 +575,7 @@ else { $db->sql_query($sql_query[$i]); } - + // // Ok tables have been built, let's fill in the basic information // @@ -572,7 +594,7 @@ else } // - // Ok at this point they have entered their admin password, let's go + // Ok at this point they have entered their admin password, let's go // ahead and create the admin account with some basic default information // that they can customize later, and write out the config file. After // this we are going to pass them over to the admin_forum.php script @@ -584,73 +606,53 @@ else // // Update the default admin user with their information. // - $sql = "INSERT INTO " . $table_prefix . "config (config_name, config_value) + $sql = "INSERT INTO " . $table_prefix . "config (config_name, config_value) VALUES ('board_startdate', " . time() . ")"; $db->sql_query($sql); - $sql = "INSERT INTO " . $table_prefix . "config (config_name, config_value) + $sql = "INSERT INTO " . $table_prefix . "config (config_name, config_value) VALUES ('default_lang', '" . str_replace("\'", "''", $language) . "')"; $db->sql_query($sql); $sql = "UPDATE " . $table_prefix . "config - SET config_value = '" . $server_name . "' + SET config_value = '" . $server_name . "' WHERE config_name = 'server_name'"; $db->sql_query($sql); $sql = "UPDATE " . $table_prefix . "config - SET config_value = '" . $server_port . "' + SET config_value = '" . $server_port . "' WHERE config_name = 'server_port'"; $db->sql_query($sql); $sql = "UPDATE " . $table_prefix . "config - SET config_value = '" . $script_path . "' + SET config_value = '" . $script_path . "' WHERE config_name = 'script_path'"; $db->sql_query($sql); $sql = "UPDATE " . $table_prefix . "config - SET config_value = '" . $board_email . "' + SET config_value = '" . $board_email . "' WHERE config_name = 'board_email'"; $db->sql_query($sql); $sql = "UPDATE " . $table_prefix . "config - SET config_value = '" . $server_name . "' + SET config_value = '" . $server_name . "' WHERE config_name = 'cookie_domain'"; $db->sql_query($sql); $sql = "UPDATE " . $table_prefix . "config - SET config_value = '" . $admin_name . "' + SET config_value = '" . $admin_name . "' WHERE config_name = 'newest_username'"; $db->sql_query($sql); - $sql = "UPDATE " . $table_prefix . "users + $sql = "UPDATE " . $table_prefix . "users SET username = '" . str_replace("\'", "''", $admin_name) . "', user_password='" . str_replace("\'", "''", $admin_pass_md5) . "', user_lang = '" . str_replace("\'", "''", $language) . "', user_email='" . str_replace("\'", "''", $board_email) . "' WHERE username = 'Admin'"; $db->sql_query($sql); - $sql = "UPDATE " . $table_prefix . "users + $sql = "UPDATE " . $table_prefix . "users SET user_regdate = " . time(); $db->sql_query($sql); - // - // Change session table to HEAP if MySQL version matches - // - if ( preg_match("/^mysql/", $dbms) ) - { - $sql = "SELECT VERSION() AS mysql_version"; - if($result = $db->sql_query($sql)) - { - $row = $db->sql_fetchrow($result); - $version = $row['mysql_version']; - - if( preg_match("/^(3\.23)|(4\.)/", $version) ) - { - $sql = "ALTER TABLE " . $table_prefix . "sessions - TYPE=HEAP"; - $db->sql_query($sql); - } - } - } - /* if ( $error != '' ) { $template->assign_block_vars("switch_error_install", array()); @@ -681,7 +683,7 @@ else $config_data .= '$dbuser = "' . $dbuser . '";' . "\n"; $config_data .= '$dbpasswd = "' . $dbpasswd . '";' . "\n\n"; $config_data .= '$table_prefix = "' . $table_prefix . '";' . "\n\n"; - $config_data .= 'define(\'PHPBB_INSTALLED\', true);'."\n\n"; + $config_data .= 'define(\'PHPBB_INSTALLED\', true);'."\n\n"; $config_data .= '?' . '>'; // Done this to prevent highlighting editors getting confused! @umask(0111); @@ -740,7 +742,7 @@ else "L_INSTRUCTION_TEXT" => $lang['Unwriteable_config'], "L_SUBMIT" => $lang['Download_config'], - "S_HIDDEN_FIELDS" => $s_hidden_fields, + "S_HIDDEN_FIELDS" => $s_hidden_fields, "S_FORM_ACTION" => "install.$phpEx") ); @@ -759,7 +761,7 @@ else // $template->assign_block_vars("switch_common_install", array()); } - // + // // First off let's check and see if we are supposed to be doing an upgrade. // if ( $upgrade == 1 && $upgrade_now == $lang['upgrade_submit'] ) @@ -769,7 +771,7 @@ else exit; } // - // Ok we are basically done with the install process let's go on + // 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 @@ -794,27 +796,21 @@ else } } -// // addslashes to vars if magic_quotes_gpc is off this is a security precaution // to prevent someone trying to break out of a SQL statement. -// function slash_input_data(&$data) { if ( is_array($data) ) { - while( list($k, $v) = each($data) ) + foreach ( $data as $k => $v ) { $data[$k] = ( is_array($v) ) ? slash_input_data($v) : addslashes($v); } - - @reset($data); } return $data; } -// -// -// +// Output page -> header function page_header($l_instructions, $s_action) { global $phpEx, $lang; @@ -854,15 +850,13 @@ td.cat { background-image: url('../admin/images/cellpic1.gif') } } -// -// -// +// Output page -> footer function page_footer($l_submit, $s_hidden_fields) { global $lang; ?> - + diff --git a/phpBB/language/en/lang_admin.php b/phpBB/language/en/lang_admin.php index 54dd662fe0..321bedac30 100644 --- a/phpBB/language/en/lang_admin.php +++ b/phpBB/language/en/lang_admin.php @@ -19,7 +19,7 @@ * ***************************************************************************/ -$this->lang = array_merge($this->lang, array( +$lang = array_merge($lang, array( 'Admin_title' => 'Administration Panel', 'No_admin' => 'You are not authorised to administer this board', 'No_frames' => 'Sorry, your browser does not support frames', diff --git a/phpBB/language/en/lang_main.php b/phpBB/language/en/lang_main.php index b695f3af5e..4f83ac1bcd 100644 --- a/phpBB/language/en/lang_main.php +++ b/phpBB/language/en/lang_main.php @@ -19,7 +19,7 @@ * ***************************************************************************/ -$this->lang = array_merge($this->lang, array( +$lang = array_merge($lang, array( 'ENCODING' => 'iso-8859-15', 'DIRECTION' => 'ltr', 'LEFT' => 'left', diff --git a/phpBB/login.php b/phpBB/login.php index aa424afe72..08fb7339b6 100644 --- a/phpBB/login.php +++ b/phpBB/login.php @@ -58,13 +58,13 @@ if ( isset($login) || isset($logout) ) 'META' => '') ); - $message = $lang['Error_login'] . '

' . sprintf($lang['Click_return_login'], '', '') . '

' . sprintf($lang['Click_return_index'], '', ''); + $message = $user->lang['Error_login'] . '

' . sprintf($user->lang['Click_return_login'], '', '') . '

' . sprintf($user->lang['Click_return_index'], '', ''); message_die(MESSAGE, $message); } } else if ( $user->data['user_id'] ) { - $session->destroy($user->data); + $user->destroy(); } // @@ -77,15 +77,15 @@ if ( isset($login) || isset($logout) ) if ( !$user->data['user_id'] ) { $template->assign_vars(array( - 'L_ENTER_PASSWORD' => $lang['Enter_password'], - 'L_SEND_PASSWORD' => $lang['Forgotten_password'], + 'L_ENTER_PASSWORD' => $user->lang['Enter_password'], + 'L_SEND_PASSWORD' => $user->lang['Forgotten_password'], - 'U_SEND_PASSWORD' => "profile.$phpEx$SID&mode=sendpassword", + 'U_SEND_PASSWORD' => "profile.$phpEx$SID&mode=sendpassword", - 'S_HIDDEN_FIELDS' => '') + 'S_HIDDEN_FIELDS' => '') ); - $page_title = $lang['Login']; + $page_title = $user->lang['Login']; include($phpbb_root_path . 'includes/page_header.'.$phpEx); $template->set_filenames(array(