diff options
Diffstat (limited to 'phpBB/install')
-rwxr-xr-x | phpBB/install/index.php | 136 | ||||
-rwxr-xr-x | phpBB/install/install_install.php | 192 | ||||
-rwxr-xr-x | phpBB/install/install_main.php | 56 |
3 files changed, 207 insertions, 177 deletions
diff --git a/phpBB/install/index.php b/phpBB/install/index.php index 21387977c1..5a0ecc7bd0 100755 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -15,11 +15,73 @@ define('IN_INSTALL', true); $phpbb_root_path = './../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); -include($phpbb_root_path . 'common.' . $phpEx); + +// Error reporting level and runtime escaping +//error_reporting(E_ERROR | E_WARNING | E_PARSE); +error_reporting(E_ALL); + +// If we are on PHP >= 6.0.0 we do not need some code +if (version_compare(phpversion(), '6.0.0', '>=')) +{ + define('STRIP', false); +} +else +{ + set_magic_quotes_runtime(0); + + // Protect against GLOBALS tricks + if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS'])) + { + exit; + } + + // Protect against _SESSION tricks + if (isset($_SESSION) && !is_array($_SESSION)) + { + exit; + } + + // Be paranoid with passed vars + if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on') + { + $not_unset = array('_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_SESSION', '_ENV', '_FILES', 'phpEx', 'phpbb_root_path'); + + // Not only will array_merge give a warning if a parameter + // is not an array, it will actually fail. So we check if + // _SESSION has been initialised. + if (!isset($_SESSION) || !is_array($_SESSION)) + { + $_SESSION = array(); + } + + // Merge all into one extremely huge array; unset + // this later + $input = array_merge($_GET, $_POST, $_COOKIE, $_SERVER, $_SESSION, $_ENV, $_FILES); + + foreach ($input as $varname => $void) + { + if (!in_array($varname, $not_unset)) + { + unset(${$varname}); + } + } + + unset($input); + } + + define('STRIP', (get_magic_quotes_gpc()) ? true : false); +} @set_time_limit(120); -include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); +// Include essential scripts +require($phpbb_root_path . 'includes/functions.'.$phpEx); +include($phpbb_root_path . 'includes/auth.' . $phpEx); +include($phpbb_root_path . 'includes/session.'.$phpEx); +include($phpbb_root_path . 'includes/template.'.$phpEx); +include($phpbb_root_path . 'includes/acm/acm_file.'.$phpEx); +include($phpbb_root_path . 'includes/acm/acm_main.'.$phpEx); +include($phpbb_root_path . 'includes/functions_admin.'.$phpEx); // Try and load an appropriate language if required $language = request_var('language', ''); @@ -67,14 +129,26 @@ if (!$language) } } -$user->lang_path = $phpbb_root_path . 'language/' . $language . '/'; -$user->add_lang(array('common', 'acp/common', 'acp/board', 'install', 'posting')); +// And finally, load the relevant language files +include($phpbb_root_path . 'language/' . $language . '/common.'.$phpEx); +include($phpbb_root_path . 'language/' . $language . '/acp/common.'.$phpEx); +include($phpbb_root_path . 'language/' . $language . '/acp/board.'.$phpEx); +include($phpbb_root_path . 'language/' . $language . '/install.'.$phpEx); +include($phpbb_root_path . 'language/' . $language . '/posting.'.$phpEx); $mode = request_var('mode', 'overview'); $sub = request_var('sub', ''); -$template->set_custom_template($phpbb_root_path . 'adm/style', 'admin'); -$template->assign_var('T_TEMPLATE_PATH', $phpbb_root_path . 'adm/style'); +// Set PHP error handler to ours +set_error_handler('msg_handler'); + +$user = new user(); +$auth = new auth(); +$cache = new cache(); +$template = new Template(); + +$template->set_custom_template('../adm/style', 'admin'); +$template->assign_var('T_TEMPLATE_PATH', '../adm/style'); $install = new module(); @@ -195,26 +269,26 @@ class module { return; } - define('HEADER_INC', true); - global $template, $user, $stage; + define('HEADER_INC', true); + global $template, $lang, $stage; $template->assign_vars(array( - 'L_INSTALL_PANEL' => $user->lang['INSTALL_PANEL'], + 'L_INSTALL_PANEL' => $lang['INSTALL_PANEL'], 'PAGE_TITLE' => $this->get_page_title(), 'META' => $this->get_meta(), - 'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'], - 'S_CONTENT_ENCODING' => $user->lang['ENCODING'], - 'S_CONTENT_DIR_LEFT' => $user->lang['LEFT'], - 'S_CONTENT_DIR_RIGHT' => $user->lang['RIGHT'], + 'S_CONTENT_DIRECTION' => $lang['DIRECTION'], + 'S_CONTENT_ENCODING' => $lang['ENCODING'], + 'S_CONTENT_DIR_LEFT' => $lang['LEFT'], + 'S_CONTENT_DIR_RIGHT' => $lang['RIGHT'], ) ); - if (!empty($user->lang['ENCODING'])) + if (!empty($lang['ENCODING'])) { - header('Content-type: text/html; charset: ' . $user->lang['ENCODING']); + header('Content-type: text/html; charset: ' . $lang['ENCODING']); } header('Cache-Control: private, no-cache="set-cookie", pre-check=0, post-check=0'); header('Expires: 0'); @@ -254,14 +328,14 @@ class module */ function get_page_title() { - global $user; + global $lang; if (!isset($this->module->page_title)) { return ''; } - return (isset($user->lang[$this->module->page_title])) ? $user->lang[$this->module->page_title] : $this->module->page_title; + return (isset($lang[$this->module->page_title])) ? $lang[$this->module->page_title] : $this->module->page_title; } /** @@ -277,7 +351,7 @@ class module */ function generate_navigation() { - global $user, $template, $phpEx; + global $lang, $template, $phpEx; if (is_array($this->module_ary)) { @@ -285,7 +359,7 @@ class module foreach ($this->module_ary as $cat_ary) { $cat = $cat_ary['name']; - $l_cat = (!empty($user->lang['CAT_' . $cat])) ? $user->lang['CAT_' . $cat] : preg_replace('#_#', ' ', $cat); + $l_cat = (!empty($lang['CAT_' . $cat])) ? $lang['CAT_' . $cat] : preg_replace('#_#', ' ', $cat); $cat = strtolower($cat); $url = $this->module_url . '?mode=' . $cat; @@ -302,7 +376,7 @@ class module $subs = $this->module_ary[$this->id]['subs']; foreach ($subs as $option) { - $l_option = (!empty($user->lang['SUB_' . $option])) ? $user->lang['SUB_' . $option] : preg_replace('#_#', ' ', $option); + $l_option = (!empty($lang['SUB_' . $option])) ? $lang['SUB_' . $option] : preg_replace('#_#', ' ', $option); $option = strtolower($option); $url = $this->module_url . '?mode=' . $this->mode . '&sub=' . $option; @@ -320,7 +394,7 @@ class module $matched = false; foreach ($subs as $option) { - $l_option = (!empty($user->lang['STAGE_' . $option])) ? $user->lang['STAGE_' . $option] : preg_replace('#_#', ' ', $option); + $l_option = (!empty($lang['STAGE_' . $option])) ? $lang['STAGE_' . $option] : preg_replace('#_#', ' ', $option); $option = strtolower($option); $matched = ($this->sub == $option) ? true : $matched; @@ -351,7 +425,7 @@ class module */ function error($error, $line, $file, $skip = false) { - global $user, $db; + global $lang, $db; if (!$skip) { @@ -359,7 +433,7 @@ class module echo '<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">'; echo '<head>'; echo '<meta http-equiv="content-type" content="text/html; charset=utf-8" />'; - echo '<title>' . $user->lang['INST_ERR_FATAL'] . '</title>'; + echo '<title>' . $lang['INST_ERR_FATAL'] . '</title>'; echo '<link href="../adm/style/admin.css" rel="stylesheet" type="text/css" media="screen" />'; echo '</head>'; echo '<body id="errorpage">'; @@ -370,10 +444,10 @@ class module echo ' <div class="panel">'; echo ' <span class="corners-top"><span></span></span>'; echo ' <div id="content">'; - echo ' <h1>' . $user->lang['INST_ERR_FATAL'] . '</h1>'; + echo ' <h1>' . $lang['INST_ERR_FATAL'] . '</h1>'; } - echo ' <p>' . $user->lang['INST_ERR_FATAL'] . "</p>\n"; + echo ' <p>' . $lang['INST_ERR_FATAL'] . "</p>\n"; echo ' <p>' . basename($file) . ' [ ' . $line . " ]</p>\n"; echo ' <p><b>' . $error . "</b></p>\n"; @@ -407,12 +481,12 @@ class module */ function db_error($error, $sql, $line, $file, $skip = false) { - global $user, $db; + global $lang, $db; $this->page_header(); - echo ' <h2 style="color:red;text-align:center">' . $user->lang['INST_ERR_FATAL'] . "</h2>\n"; - echo ' <p>' . $user->lang['INST_ERR_FATAL_DB'] . "</p>\n"; + echo ' <h2 style="color:red;text-align:center">' . $lang['INST_ERR_FATAL'] . "</h2>\n"; + echo ' <p>' . $lang['INST_ERR_FATAL_DB'] . "</p>\n"; echo ' <p>' . basename($file) . ' [ ' . $line . " ]</p>\n"; echo ' <p>SQL : ' . $sql . "</p>\n"; echo ' <p><b>' . $error . "</b></p>\n"; @@ -432,7 +506,7 @@ class module */ function input_field($name, $type, $value='', $options='') { - global $user; + global $lang; $tpl_type = explode(':', $type); $tpl = ''; @@ -460,8 +534,8 @@ class module $tpl_type_cond = explode('_', $tpl_type[1]); $type_no = ($tpl_type_cond[0] == 'disabled' || $tpl_type_cond[0] == 'enabled') ? false : true; - $tpl_no = '<input type="radio" name="' . $name . '" value="0"' . $key_no . ' class="radio" /> ' . (($type_no) ? $user->lang['NO'] : $user->lang['DISABLED']); - $tpl_yes = '<input type="radio" name="' . $name . '" value="1"' . $key_yes . ' class="radio" /> ' . (($type_no) ? $user->lang['YES'] : $user->lang['ENABLED']); + $tpl_no = '<input type="radio" name="' . $name . '" value="0"' . $key_no . ' class="radio" /> ' . (($type_no) ? $lang['NO'] : $lang['DISABLED']); + $tpl_yes = '<input type="radio" name="' . $name . '" value="1"' . $key_yes . ' class="radio" /> ' . (($type_no) ? $lang['YES'] : $lang['ENABLED']); $tpl = ($tpl_type_cond[0] == 'yes' || $tpl_type_cond[0] == 'enabled') ? $tpl_yes . ' ' . $tpl_no : $tpl_no . ' ' . $tpl_yes; break; diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 1e3163cabe..116fc7f2f6 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -33,17 +33,17 @@ class install_install extends module function main($mode, $sub) { - global $user, $template; + global $lang, $template; switch ($sub) { case 'intro' : - $this->page_title = $user->lang['SUB_INTRO']; + $this->page_title = $lang['SUB_INTRO']; $template->assign_vars(array( - 'TITLE' => $user->lang['INSTALL_INTRO'], - 'BODY' => $user->lang['INSTALL_INTRO_BODY'], - 'L_SUBMIT' => $user->lang['NEXT'], + 'TITLE' => $lang['INSTALL_INTRO'], + 'BODY' => $lang['INSTALL_INTRO_BODY'], + 'L_SUBMIT' => $lang['NEXT'], 'U_ACTION' => $this->p_master->module_url . "?mode=$mode&sub=requirements", )); @@ -89,13 +89,13 @@ class install_install extends module */ function check_server_requirements($mode, $sub) { - global $user, $template, $phpbb_root_path, $phpEx; + global $lang, $template, $phpbb_root_path, $phpEx; - $this->page_title = $user->lang['STAGE_REQUIREMENTS']; + $this->page_title = $lang['STAGE_REQUIREMENTS']; $template->assign_vars(array( - 'TITLE' => $user->lang['REQUIREMENTS_TITLE'], - 'BODY' => $user->lang['REQUIREMENTS_EXPLAIN'], + 'TITLE' => $lang['REQUIREMENTS_TITLE'], + 'BODY' => $lang['REQUIREMENTS_EXPLAIN'], )); $passed = array('php' => false, 'db' => false, 'files' => false); @@ -104,8 +104,8 @@ class install_install extends module $template->assign_block_vars('checks', array( 'S_LEGEND' => true, 'S_FIRST_ROW' => true, - 'LEGEND' => $user->lang['PHP_SETTINGS'], - 'LEGEND_EXPLAIN' => $user->lang['PHP_SETTINGS_EXPLAIN'], + 'LEGEND' => $lang['PHP_SETTINGS'], + 'LEGEND_EXPLAIN' => $lang['PHP_SETTINGS_EXPLAIN'], )); // Test the minimum PHP version @@ -113,21 +113,21 @@ class install_install extends module if (version_compare($php_version, '4.3.3') < 0) { - $result = '<b style="color:red">' . $user->lang['NO'] . '</b>'; + $result = '<b style="color:red">' . $lang['NO'] . '</b>'; } else { $passed['php'] = true; // We also give feedback on whether we're running in safe mode - $result = '<b style="color:green">' . $user->lang['YES']; + $result = '<b style="color:green">' . $lang['YES']; if (@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'on') { - $result .= ', ' . $user->lang['PHP_SAFE_MODE']; + $result .= ', ' . $lang['PHP_SAFE_MODE']; } $result .= '</b>'; } $template->assign_block_vars('checks', array( - 'TITLE' => $user->lang['PHP_VERSION_REQD'], + 'TITLE' => $lang['PHP_VERSION_REQD'], 'RESULT' => $result, 'S_EXPLAIN' => false, @@ -137,16 +137,16 @@ class install_install extends module // Check for register_globals being enabled if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on') { - $result = '<b style="color:red">' . $user->lang['NO'] . '</b>'; + $result = '<b style="color:red">' . $lang['NO'] . '</b>'; } else { - $result = '<b style="color:green">' . $user->lang['YES'] . '</b>'; + $result = '<b style="color:green">' . $lang['YES'] . '</b>'; } $template->assign_block_vars('checks', array( - 'TITLE' => $user->lang['PHP_REGISTER_GLOBALS'], - 'TITLE_EXPLAIN' => $user->lang['PHP_REGISTER_GLOBALS_EXPLAIN'], + 'TITLE' => $lang['PHP_REGISTER_GLOBALS'], + 'TITLE_EXPLAIN' => $lang['PHP_REGISTER_GLOBALS_EXPLAIN'], 'RESULT' => $result, 'S_EXPLAIN' => true, @@ -157,8 +157,8 @@ class install_install extends module $template->assign_block_vars('checks', array( 'S_LEGEND' => true, 'S_FIRST_ROW' => false, - 'LEGEND' => $user->lang['PHP_SUPPORTED_DB'], - 'LEGEND_EXPLAIN' => $user->lang['PHP_SUPPORTED_DB_EXPLAIN'], + 'LEGEND' => $lang['PHP_SUPPORTED_DB'], + 'LEGEND_EXPLAIN' => $lang['PHP_SUPPORTED_DB_EXPLAIN'], )); $dlls_db = array(); @@ -172,8 +172,8 @@ class install_install extends module if (!$this->can_load_dll($dll)) { $template->assign_block_vars('checks', array( - 'TITLE' => $user->lang['DLL_' . strtoupper($db_name)], - 'RESULT' => '<b style="color:red">' . $user->lang['UNAVAILABLE'] . '</b>', + 'TITLE' => $lang['DLL_' . strtoupper($db_name)], + 'RESULT' => '<b style="color:red">' . $lang['UNAVAILABLE'] . '</b>', 'S_EXPLAIN' => false, 'S_LEGEND' => false, @@ -183,8 +183,8 @@ class install_install extends module } $template->assign_block_vars('checks', array( - 'TITLE' => $user->lang['DLL_' . strtoupper($db_name)], - 'RESULT' => '<b style="color:green">' . $user->lang['AVAILABLE'] . '</b>', + 'TITLE' => $lang['DLL_' . strtoupper($db_name)], + 'RESULT' => '<b style="color:green">' . $lang['AVAILABLE'] . '</b>', 'S_EXPLAIN' => false, 'S_LEGEND' => false, @@ -196,8 +196,8 @@ class install_install extends module $template->assign_block_vars('checks', array( 'S_LEGEND' => true, 'S_FIRST_ROW' => false, - 'LEGEND' => $user->lang['PHP_OPTIONAL_MODULE'], - 'LEGEND_EXPLAIN' => $user->lang['PHP_OPTIONAL_MODULE_EXPLAIN'], + 'LEGEND' => $lang['PHP_OPTIONAL_MODULE'], + 'LEGEND_EXPLAIN' => $lang['PHP_OPTIONAL_MODULE_EXPLAIN'], )); foreach ($this->php_dlls_other as $dll) @@ -207,8 +207,8 @@ class install_install extends module if (!$this->can_load_dll($dll)) { $template->assign_block_vars('checks', array( - 'TITLE' => $user->lang['DLL_' . strtoupper($dll)], - 'RESULT' => '<b style="color:red">' . $user->lang['UNAVAILABLE'] . '</b>', + 'TITLE' => $lang['DLL_' . strtoupper($dll)], + 'RESULT' => '<b style="color:red">' . $lang['UNAVAILABLE'] . '</b>', 'S_EXPLAIN' => false, 'S_LEGEND' => false, @@ -217,8 +217,8 @@ class install_install extends module } } $template->assign_block_vars('checks', array( - 'TITLE' => $user->lang['DLL_' . strtoupper($dll)], - 'RESULT' => '<b style="color:green">' . $user->lang['AVAILABLE'] . '</b>', + 'TITLE' => $lang['DLL_' . strtoupper($dll)], + 'RESULT' => '<b style="color:green">' . $lang['AVAILABLE'] . '</b>', 'S_EXPLAIN' => false, 'S_LEGEND' => false, @@ -257,8 +257,8 @@ class install_install extends module } $template->assign_block_vars('checks', array( - 'TITLE' => $user->lang['APP_MAGICK'], - 'RESULT' => ($img_imagick) ? '<b style="color:green">' . $user->lang['AVAILABLE'] . ', ' . $img_imagick . '</b>' : '<b style="color:blue">' . $user->lang['NO_LOCATION'] . '</b>', + 'TITLE' => $lang['APP_MAGICK'], + 'RESULT' => ($img_imagick) ? '<b style="color:green">' . $lang['AVAILABLE'] . ', ' . $img_imagick . '</b>' : '<b style="color:blue">' . $lang['NO_LOCATION'] . '</b>', 'S_EXPLAIN' => false, 'S_LEGEND' => false, @@ -268,8 +268,8 @@ class install_install extends module $template->assign_block_vars('checks', array( 'S_LEGEND' => true, 'S_FIRST_ROW' => false, - 'LEGEND' => $user->lang['FILES_REQUIRED'], - 'LEGEND_EXPLAIN' => $user->lang['FILES_REQUIRED_EXPLAIN'], + 'LEGEND' => $lang['FILES_REQUIRED'], + 'LEGEND_EXPLAIN' => $lang['FILES_REQUIRED_EXPLAIN'], )); $directories = array('cache/', 'files/', 'store/'); @@ -294,8 +294,8 @@ class install_install extends module $passed['files'] = ($exists && $write && $passed['files']) ? true : false; - $exists = ($exists) ? '<b style="color:green">' . $user->lang['FILE_FOUND'] . '</b>' : '<b style="color:red">' . $user->lang['FILE_NOT_FOUND'] . '</b>'; - $write = ($write) ? ', <b style="color:green">' . $user->lang['FILE_WRITEABLE'] . '</b>' : (($exists) ? ', <b style="color:red">' . $user->lang['FILE_UNWRITEABLE'] . '</b>' : ''); + $exists = ($exists) ? '<b style="color:green">' . $lang['FILE_FOUND'] . '</b>' : '<b style="color:red">' . $lang['FILE_NOT_FOUND'] . '</b>'; + $write = ($write) ? ', <b style="color:green">' . $lang['FILE_WRITEABLE'] . '</b>' : (($exists) ? ', <b style="color:red">' . $lang['FILE_UNWRITEABLE'] . '</b>' : ''); $template->assign_block_vars('checks', array( 'TITLE' => $dir, @@ -310,8 +310,8 @@ class install_install extends module $template->assign_block_vars('checks', array( 'S_LEGEND' => true, 'S_FIRST_ROW' => false, - 'LEGEND' => $user->lang['FILES_OPTIONAL'], - 'LEGEND_EXPLAIN' => $user->lang['FILES_OPTIONAL_EXPLAIN'], + 'LEGEND' => $lang['FILES_OPTIONAL'], + 'LEGEND_EXPLAIN' => $lang['FILES_OPTIONAL_EXPLAIN'], )); // config.php ... let's just warn the user it's not writeable @@ -329,8 +329,8 @@ class install_install extends module $write = $exists = false; } - $exists_str = ($exists) ? '<b style="color:green">' . $user->lang['FILE_FOUND'] . '</b>' : '<b style="color:red">' . $user->lang['FILE_NOT_FOUND'] . '</b>'; - $write_str = ($write) ? ', <b style="color:green">' . $user->lang['FILE_WRITEABLE'] . '</b>' : (($exists) ? ', <b style="color:red">' . $user->lang['FILE_UNWRITEABLE'] . '</b>' : ''); + $exists_str = ($exists) ? '<b style="color:green">' . $lang['FILE_FOUND'] . '</b>' : '<b style="color:red">' . $lang['FILE_NOT_FOUND'] . '</b>'; + $write_str = ($write) ? ', <b style="color:green">' . $lang['FILE_WRITEABLE'] . '</b>' : (($exists) ? ', <b style="color:red">' . $lang['FILE_UNWRITEABLE'] . '</b>' : ''); $template->assign_block_vars('checks', array( 'TITLE' => $dir, @@ -344,7 +344,7 @@ class install_install extends module $s_hidden_fields = ($img_imagick) ? '<input type="hidden" name="img_imagick" value="' . addslashes($img_imagick) . '" />' : ''; $url = ($passed['php'] && $passed['db'] && $passed['files']) ? $this->p_master->module_url . "?mode=$mode&sub=database" : $this->p_master->module_url . "?mode=$mode&sub=requirements"; - $submit = ($passed['php'] && $passed['db'] && $passed['files']) ? $user->lang['INSTALL_START'] : $user->lang['INSTALL_TEST']; + $submit = ($passed['php'] && $passed['db'] && $passed['files']) ? $lang['INSTALL_START'] : $lang['INSTALL_TEST']; $template->assign_vars(array( @@ -359,9 +359,9 @@ class install_install extends module */ function obtain_database_settings($mode, $sub) { - global $user, $template, $phpEx; + global $lang, $template, $phpEx; - $this->page_title = $user->lang['STAGE_DATABASE']; + $this->page_title = $lang['STAGE_DATABASE']; // Obtain any submitted data foreach ($this->request_vars as $var) @@ -379,7 +379,7 @@ class install_install extends module { if (!$this->can_load_dll($this->available_dbms[$dbms]['MODULE'])) { - $error['db'][] = $user->lang['INST_ERR_NO_DB'];; + $error['db'][] = $lang['INST_ERR_NO_DB'];; } } @@ -388,15 +388,15 @@ class install_install extends module $template->assign_block_vars('checks', array( 'S_LEGEND' => true, 'S_FIRST_ROW' => true, - 'LEGEND' => $user->lang['DB_CONNECTION'], + 'LEGEND' => $lang['DB_CONNECTION'], 'LEGEND_EXPLAIN' => false, )); if ($connect_test) { $template->assign_block_vars('checks', array( - 'TITLE' => $user->lang['DB_TEST'], - 'RESULT' => '<b style="color:green">' . $user->lang['SUCCESSFUL_CONNECT'] . '</b>', + 'TITLE' => $lang['DB_TEST'], + 'RESULT' => '<b style="color:green">' . $lang['SUCCESSFUL_CONNECT'] . '</b>', 'S_EXPLAIN' => false, 'S_LEGEND' => false, @@ -405,7 +405,7 @@ class install_install extends module else { $template->assign_block_vars('checks', array( - 'TITLE' => $user->lang['DB_TEST'], + 'TITLE' => $lang['DB_TEST'], 'RESULT' => '<b style="color:red">' . implode('<br />', $error) . '</b>', 'S_EXPLAIN' => false, @@ -447,7 +447,7 @@ class install_install extends module { $template->assign_block_vars('options', array( 'S_LEGEND' => true, - 'LEGEND' => $user->lang[$vars]) + 'LEGEND' => $lang[$vars]) ); continue; @@ -457,10 +457,10 @@ class install_install extends module $template->assign_block_vars('options', array( 'KEY' => $config_key, - 'TITLE' => $user->lang[$vars['lang']], + 'TITLE' => $lang[$vars['lang']], 'S_EXPLAIN' => $vars['explain'], 'S_LEGEND' => false, - 'TITLE_EXPLAIN' => ($vars['explain']) ? $user->lang[$vars['lang'] . '_EXPLAIN'] : '', + 'TITLE_EXPLAIN' => ($vars['explain']) ? $lang[$vars['lang'] . '_EXPLAIN'] : '', 'CONTENT' => $this->p_master->input_field($config_key, $vars['type'], $$config_key, $options), ) ); @@ -486,7 +486,7 @@ class install_install extends module $s_hidden_fields .= ($connect_test) ? '' : '<input type="hidden" name="testdb" value="true" />'; // $url = ($connect_test) ? "install.$phpEx?stage=1" : $this->p_master->module_url . "?mode=$mode&sub=database"; - $submit = $user->lang['NEXT_STEP']; + $submit = $lang['NEXT_STEP']; $template->assign_vars(array( 'L_SUBMIT' => $submit, @@ -500,9 +500,9 @@ class install_install extends module */ function obtain_admin_settings($mode, $sub) { - global $user, $template, $phpEx; + global $lang, $template, $phpEx; - $this->page_title = $user->lang['STAGE_ADMINISTRATOR']; + $this->page_title = $lang['STAGE_ADMINISTRATOR']; // Obtain any submitted data foreach ($this->request_vars as $var) @@ -520,39 +520,39 @@ class install_install extends module // Check the entered email address and password if ($admin_name == '' || $admin_pass1 == '' || $admin_pass2 == '' || $board_email1 == '' || $board_email2 =='') { - $error[] = $user->lang['INST_ERR_MISSING_DATA']; + $error[] = $lang['INST_ERR_MISSING_DATA']; } if ($admin_pass1 != $admin_pass2 && $admin_pass1 != '') { - $error[] = $user->lang['INST_ERR_PASSWORD_MISMATCH']; + $error[] = $lang['INST_ERR_PASSWORD_MISMATCH']; } // Test against the default password rules if ($admin_pass1 != '' && strlen($admin_pass1) < 6) { - $error[] = $user->lang['INST_ERR_PASSWORD_TOO_SHORT']; + $error[] = $lang['INST_ERR_PASSWORD_TOO_SHORT']; } if ($admin_pass1 != '' && strlen($admin_pass1) > 30) { - $error[] = $user->lang['INST_ERR_PASSWORD_TOO_LONG']; + $error[] = $lang['INST_ERR_PASSWORD_TOO_LONG']; } if ($board_email1 != $board_email2 && $board_email1 != '') { - $error[] = $user->lang['INST_ERR_EMAIL_MISMATCH']; + $error[] = $lang['INST_ERR_EMAIL_MISMATCH']; } if ($board_email1 != '' && !preg_match('#^[a-z0-9\.\-_\+]+?@(.*?\.)*?[a-z0-9\-_]+?\.[a-z]{2,4}$#i', $board_email1)) { - $error[] = $user->lang['INST_ERR_EMAIL_INVALID']; + $error[] = $lang['INST_ERR_EMAIL_INVALID']; } $template->assign_block_vars('checks', array( 'S_LEGEND' => true, 'S_FIRST_ROW' => true, - 'LEGEND' => $user->lang['STAGE_ADMINISTRATOR'], + 'LEGEND' => $lang['STAGE_ADMINISTRATOR'], 'LEGEND_EXPLAIN' => false, )); @@ -560,8 +560,8 @@ class install_install extends module { $passed = true; $template->assign_block_vars('checks', array( - 'TITLE' => $user->lang['ADMIN_TEST'], - 'RESULT' => '<b style="color:green">' . $user->lang['TESTS_PASSED'] . '</b>', + 'TITLE' => $lang['ADMIN_TEST'], + 'RESULT' => '<b style="color:green">' . $lang['TESTS_PASSED'] . '</b>', 'S_EXPLAIN' => false, 'S_LEGEND' => false, @@ -570,7 +570,7 @@ class install_install extends module else { $template->assign_block_vars('checks', array( - 'TITLE' => $user->lang['ADMIN_TEST'], + 'TITLE' => $lang['ADMIN_TEST'], 'RESULT' => '<b style="color:red">' . implode('<br />', $error) . '</b>', 'S_EXPLAIN' => false, @@ -592,7 +592,7 @@ class install_install extends module { $template->assign_block_vars('options', array( 'S_LEGEND' => true, - 'LEGEND' => $user->lang[$vars]) + 'LEGEND' => $lang[$vars]) ); continue; @@ -602,10 +602,10 @@ class install_install extends module $template->assign_block_vars('options', array( 'KEY' => $config_key, - 'TITLE' => $user->lang[$vars['lang']], + 'TITLE' => $lang[$vars['lang']], 'S_EXPLAIN' => $vars['explain'], 'S_LEGEND' => false, - 'TITLE_EXPLAIN' => ($vars['explain']) ? $user->lang[$vars['lang'] . '_EXPLAIN'] : '', + 'TITLE_EXPLAIN' => ($vars['explain']) ? $lang[$vars['lang'] . '_EXPLAIN'] : '', 'CONTENT' => $this->p_master->input_field($config_key, $vars['type'], $$config_key, $options), ) ); @@ -634,7 +634,7 @@ class install_install extends module $s_hidden_fields .= '<input type="hidden" name="' . $config_key . '" value="' . $$config_key . '" />'; } - $submit = $user->lang['NEXT_STEP']; + $submit = $lang['NEXT_STEP']; $url = ($passed) ? $this->p_master->module_url . "?mode=$mode&sub=config_file" : $this->p_master->module_url . "?mode=$mode&sub=administrator"; $s_hidden_fields .= ($passed) ? '' : '<input type="hidden" name="check" value="true" />'; @@ -651,9 +651,9 @@ class install_install extends module */ function create_config_file($mode, $sub) { - global $user, $template, $phpbb_root_path, $phpEx; + global $lang, $template, $phpbb_root_path, $phpEx; - $this->page_title = $user->lang['STAGE_CONFIG_FILE']; + $this->page_title = $lang['STAGE_CONFIG_FILE']; // Obtain any submitted data foreach ($this->request_vars as $var) @@ -758,11 +758,11 @@ class install_install extends module // The option to download the config file is always available, so output it here $template->assign_vars(array( - 'BODY' => $user->lang['CONFIG_FILE_UNABLE_WRITE'], - 'L_DL_CONFIG' => $user->lang['DL_CONFIG'], - 'L_DL_CONFIG_EXPLAIN' => $user->lang['DL_CONFIG_EXPLAIN'], - 'L_DL_DONE' => $user->lang['DL_DONE'], - 'L_DL_DOWNLOAD' => $user->lang['DL_DOWNLOAD'], + 'BODY' => $lang['CONFIG_FILE_UNABLE_WRITE'], + 'L_DL_CONFIG' => $lang['DL_CONFIG'], + 'L_DL_CONFIG_EXPLAIN' => $lang['DL_CONFIG_EXPLAIN'], + 'L_DL_DONE' => $lang['DL_DONE'], + 'L_DL_DOWNLOAD' => $lang['DL_DOWNLOAD'], 'S_HIDDEN' => $s_hidden_fields, 'S_SHOW_DOWNLOAD' => true, 'U_ACTION' => $this->p_master->module_url . "?mode=$mode&sub=config_file", @@ -772,8 +772,8 @@ class install_install extends module else { $template->assign_vars(array( - 'BODY' => $user->lang['CONFIG_FILE_WRITTEN'], - 'L_SUBMIT' => $user->lang['NEXT_STEP'], + 'BODY' => $lang['CONFIG_FILE_WRITTEN'], + 'L_SUBMIT' => $lang['NEXT_STEP'], 'S_HIDDEN' => $s_hidden_fields, 'U_ACTION' => $this->p_master->module_url . "?mode=$mode&sub=advanced", )); @@ -787,9 +787,9 @@ class install_install extends module */ function obtain_advanced_settings($mode, $sub) { - global $user, $template, $phpEx; + global $lang, $template, $phpEx; - $this->page_title = $user->lang['STAGE_ADVANCED']; + $this->page_title = $lang['STAGE_ADVANCED']; // Obtain any submitted data foreach ($this->request_vars as $var) @@ -814,7 +814,7 @@ class install_install extends module { $template->assign_block_vars('options', array( 'S_LEGEND' => true, - 'LEGEND' => $user->lang[$vars]) + 'LEGEND' => $lang[$vars]) ); continue; @@ -824,10 +824,10 @@ class install_install extends module $template->assign_block_vars('options', array( 'KEY' => $config_key, - 'TITLE' => $user->lang[$vars['lang']], + 'TITLE' => $lang[$vars['lang']], 'S_EXPLAIN' => $vars['explain'], 'S_LEGEND' => false, - 'TITLE_EXPLAIN' => ($vars['explain']) ? $user->lang[$vars['lang'] . '_EXPLAIN'] : '', + 'TITLE_EXPLAIN' => ($vars['explain']) ? $lang[$vars['lang'] . '_EXPLAIN'] : '', 'CONTENT' => $this->p_master->input_field($config_key, $vars['type'], $$config_key, $options), ) ); @@ -844,14 +844,14 @@ class install_install extends module $s_hidden_fields .= '<input type="hidden" name="' . $config_key . '" value="' . $$config_key . '" />'; } - $submit = $user->lang['NEXT_STEP']; + $submit = $lang['NEXT_STEP']; // $url = ($passed) ? $this->p_master->module_url . "?mode=$mode&sub=final" : $this->p_master->module_url . "?mode=$mode&sub=advanced"; // $s_hidden_fields .= ($passed) ? '' : '<input type="hidden" name="check" value="true" />'; $url = $this->p_master->module_url . "?mode=$mode&sub=final"; $template->assign_vars(array( - 'BODY' => $user->lang['STAGE_ADVANCED_EXPLAIN'], + 'BODY' => $lang['STAGE_ADVANCED_EXPLAIN'], 'L_SUBMIT' => $submit, 'S_HIDDEN' => $s_hidden_fields, 'U_ACTION' => $url, @@ -863,7 +863,7 @@ class install_install extends module */ function load_schema($mode, $sub) { - global $db, $user, $template, $phpbb_root_path, $phpEx; + global $db, $lang, $template, $phpbb_root_path, $phpEx; // Obtain any submitted data foreach ($this->request_vars as $var) @@ -1091,9 +1091,9 @@ class install_install extends module */ function email_admin($mode, $sub) { - global $auth, $config, $db, $user, $template, $user, $SID, $phpbb_root_path, $phpEx; + global $auth, $config, $db, $lang, $template, $user, $SID, $phpbb_root_path, $phpEx; - $this->page_title = $user->lang['STAGE_FINAL']; + $this->page_title = $lang['STAGE_FINAL']; // Obtain any submitted data foreach ($this->request_vars as $var) @@ -1153,9 +1153,9 @@ class install_install extends module add_log('admin', 'LOG_INSTALL_INSTALLED', $config['version']); $template->assign_vars(array( - 'TITLE' => $user->lang['INSTALL_CONGRATS'], - 'BODY' => sprintf($user->lang['INSTALL_CONGRATS_EXPLAIN'], '<a href="../docs/README.html" target="_blank">', '</a>'), - 'L_SUBMIT' => $user->lang['INSTALL_LOGIN'], + 'TITLE' => $lang['INSTALL_CONGRATS'], + 'BODY' => sprintf($lang['INSTALL_CONGRATS_EXPLAIN'], '<a href="../docs/README.html" target="_blank">', '</a>'), + 'L_SUBMIT' => $lang['INSTALL_LOGIN'], 'U_ACTION' => $phpbb_root_path . 'adm/index.' . $phpEx . $SID, )); } @@ -1176,7 +1176,7 @@ class install_install extends module */ function connect_check_db($error_connect, &$error, $dbms, $table_prefix, $dbhost, $dbuser, $dbpasswd, $dbname, $dbport) { - global $phpbb_root_path, $phpEx, $config, $user; + global $phpbb_root_path, $phpEx, $config, $lang; // Include the DB layer include($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx); @@ -1190,7 +1190,7 @@ class install_install extends module if (is_array($db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false))) { $db_error = $db->sql_error(); - $error[] = $user->lang['INST_ERR_DB_CONNECT'] . '<br />' . (($db_error['message']) ? $db_error['message'] : $user->lang['INST_ERR_DB_NO_ERROR']); + $error[] = $lang['INST_ERR_DB_CONNECT'] . '<br />' . (($db_error['message']) ? $db_error['message'] : $lang['INST_ERR_DB_NO_ERROR']); } else { @@ -1246,7 +1246,7 @@ class install_install extends module // work if (in_array(strtolower($row[$field]), $table_ary)) { - $error[] = $user->lang['INST_ERR_PREFIX']; + $error[] = $lang['INST_ERR_PREFIX']; break; } } @@ -1322,14 +1322,14 @@ class install_install extends module */ function mail_auth_select($selected_method) { - global $user; + global $lang; $auth_methods = array('PLAIN', 'LOGIN', 'CRAM-MD5', 'DIGEST-MD5', 'POP-BEFORE-SMTP'); $s_smtp_auth_options = ''; foreach ($auth_methods as $method) { - $s_smtp_auth_options .= '<option value="' . $method . '"' . (($selected_method == $method) ? ' selected="selected"' : '') . '>' . $user->lang['SMTP_' . str_replace('-', '_', $method)] . '</option>'; + $s_smtp_auth_options .= '<option value="' . $method . '"' . (($selected_method == $method) ? ' selected="selected"' : '') . '>' . $lang['SMTP_' . str_replace('-', '_', $method)] . '</option>'; } return $s_smtp_auth_options; diff --git a/phpBB/install/install_main.php b/phpBB/install/install_main.php index c8801f77ba..ce81df92db 100755 --- a/phpBB/install/install_main.php +++ b/phpBB/install/install_main.php @@ -33,21 +33,21 @@ class install_main extends module function main($mode, $sub) { - global $user, $template; + global $lang, $template; switch ($sub) { case 'intro' : - $title = $user->lang['SUB_INTRO']; - $body = $user->lang['OVERVIEW_BODY']; + $title = $lang['SUB_INTRO']; + $body = $lang['OVERVIEW_BODY']; break; case 'license' : - $title = $user->lang['GPL']; + $title = $lang['GPL']; $body = implode("<br/>\n", file('../docs/COPYING')); break; case 'support' : - $title = $user->lang['SUB_SUPPORT']; - $body = $user->lang['SUPPORT_BODY']; + $title = $lang['SUB_SUPPORT']; + $body = $lang['SUPPORT_BODY']; break; } @@ -60,48 +60,4 @@ class install_main extends module )); } } - -/** -* Add default modules -function add_default_modules() -{ - global $db, $phpbb_root_path, $phpEx; - - include_once($phpbb_root_path . 'includes/acp_modules.' . $phpEx); - $module_class = 'acp'; - - $_module = &new acp_modules(); - - // Get the modules we want to add... - $module_info = $_module->get_module_infos('', $module_class); - - foreach ($module_info as $module_name => $fileinfo) - { - foreach ($fileinfo['modes'] as $module_mode => $row) - { - $module_data = array( - 'module_name' => $module_name, - 'module_enabled' => 1, - 'module_display' => (isset($row['display'])) ? $row['display'] : 1, - 'parent_id' => $row['parent_id'], - 'module_class' => $module_class, - 'module_langname' => $row['title'], - 'module_mode' => $module_mode, - 'module_auth' => $row['auth'], - ); - - $_module->>update_module_data($module_data); - } - } - - // recalculate binary tree - if (!function_exists('recalc_btree')) - { - include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx); - } - - recalc_btree('module_id', MODULES_TABLE, $module_class); - $_module->remove_cache_file(); -} -*/ ?>
\ No newline at end of file |