aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-04-28 12:49:44 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-04-28 12:49:44 +0000
commit34fcc7dbe12b823667edfe5a35b0d2dfcea2af37 (patch)
tree4095518177ecb7b75a38d09e2d8c9eed49232fa7 /phpBB
parent1b065fb74afedf2513d5dab4726516f8778cdf9d (diff)
downloadforums-34fcc7dbe12b823667edfe5a35b0d2dfcea2af37.tar
forums-34fcc7dbe12b823667edfe5a35b0d2dfcea2af37.tar.gz
forums-34fcc7dbe12b823667edfe5a35b0d2dfcea2af37.tar.bz2
forums-34fcc7dbe12b823667edfe5a35b0d2dfcea2af37.tar.xz
forums-34fcc7dbe12b823667edfe5a35b0d2dfcea2af37.zip
graham, sorry for this but i had to... ;)
- utilize common.php in installer (we only need to change one location then) - use $user->lang instead of $lang to be able to use language template vars and having consistant namings git-svn-id: file:///svn/phpbb/trunk@5855 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rwxr-xr-xphpBB/adm/style/install_install.html72
-rw-r--r--phpBB/common.php83
-rw-r--r--phpBB/includes/constants.php11
-rwxr-xr-xphpBB/install/index.php136
-rwxr-xr-xphpBB/install/install_install.php192
-rwxr-xr-xphpBB/install/install_main.php56
6 files changed, 277 insertions, 273 deletions
diff --git a/phpBB/adm/style/install_install.html b/phpBB/adm/style/install_install.html
index efa52fa94b..4b94023226 100755
--- a/phpBB/adm/style/install_install.html
+++ b/phpBB/adm/style/install_install.html
@@ -5,41 +5,53 @@
<h2>{TITLE}</h2>
{BODY}
-<!-- BEGIN checks -->
- <!-- IF checks.S_LEGEND -->
- <!-- IF not checks.S_FIRST_ROW -->
- </fieldset>
- <!-- ENDIF -->
- <fieldset>
- <legend>{checks.LEGEND}</legend>
- <!-- IF checks.LEGEND_EXPLAIN --><p>{checks.LEGEND_EXPLAIN}</p><!-- ENDIF -->
- <!-- ELSE -->
-
- <dl>
- <dt>{checks.TITLE}:</label><!-- IF checks.S_EXPLAIN --><br /><span>{checks.TITLE_EXPLAIN}</span><!-- ENDIF --></dt>
- <dd>{checks.RESULT}</dd>
- </dl>
- <!-- ENDIF -->
-<!-- END checks -->
-</fieldset>
+<!-- IF .checks -->
+ <fieldset>
-<!-- BEGIN options -->
- <!-- IF options.S_LEGEND -->
- <!-- IF not options.S_FIRST_ROW -->
+ <!-- BEGIN checks -->
+ <!-- IF checks.S_LEGEND -->
+ <!-- IF not checks.S_FIRST_ROW -->
</fieldset>
+
+ <fieldset>
+ <!-- ENDIF -->
+ <legend>{checks.LEGEND}</legend>
+ <!-- IF checks.LEGEND_EXPLAIN --><p>{checks.LEGEND_EXPLAIN}</p><!-- ENDIF -->
+ <!-- ELSE -->
+
+ <dl>
+ <dt>{checks.TITLE}:</label><!-- IF checks.S_EXPLAIN --><br /><span>{checks.TITLE_EXPLAIN}</span><!-- ENDIF --></dt>
+ <dd>{checks.RESULT}</dd>
+ </dl>
<!-- ENDIF -->
- <fieldset>
- <legend>{options.LEGEND}</legend>
- <!-- ELSE -->
+ <!-- END checks -->
- <dl>
- <dt><label for="{options.KEY}">{options.TITLE}:</label><!-- IF options.S_EXPLAIN --><br /><span>{options.TITLE_EXPLAIN}</span><!-- ENDIF --></dt>
- <dd>{options.CONTENT}</dd>
- </dl>
+ </fieldset>
+<!-- ENDIF -->
- <!-- ENDIF -->
-<!-- END options -->
-</fieldset>
+<!-- IF .options -->
+ <fieldset>
+
+ <!-- BEGIN options -->
+ <!-- IF options.S_LEGEND -->
+ <!-- IF not options.S_FIRST_ROW -->
+ </fieldset>
+
+ <fieldset>
+ <!-- ENDIF -->
+ <legend>{options.LEGEND}</legend>
+ <!-- ELSE -->
+
+ <dl>
+ <dt><label for="{options.KEY}">{options.TITLE}:</label><!-- IF options.S_EXPLAIN --><br /><span>{options.TITLE_EXPLAIN}</span><!-- ENDIF --></dt>
+ <dd>{options.CONTENT}</dd>
+ </dl>
+
+ <!-- ENDIF -->
+ <!-- END options -->
+
+ </fieldset>
+<!-- ENDIF -->
<!-- IF S_SHOW_DOWNLOAD -->
<fieldset>
diff --git a/phpBB/common.php b/phpBB/common.php
index 6d3efc681c..b037d87ea9 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -23,8 +23,8 @@ if (!defined('IN_PHPBB'))
$starttime = explode(' ', microtime());
$starttime = $starttime[1] + $starttime[0];
-error_reporting(E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables
-//error_reporting(E_ALL);
+//error_reporting(E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables
+error_reporting(E_ALL);
/**
* Remove variables created by register_globals from the global scope
@@ -80,7 +80,7 @@ function deregister_globals()
}
// If we are on PHP >= 6.0.0 we do not need some code
-if (version_compare(phpversion(), '6.0.0', '>='))
+if (version_compare(phpversion(), '6.0.0-dev', '>='))
{
define('STRIP', false);
}
@@ -103,38 +103,45 @@ if (defined('IN_CRON'))
$phpbb_root_path = getcwd() . '/';
}
-require($phpbb_root_path . 'config.'.$phpEx);
-
-if (!defined('PHPBB_INSTALLED'))
+// Run the following code if not currently installing
+if (!defined('IN_INSTALL'))
{
- header('Location: install/index.'.$phpEx);
- exit;
-}
+ require($phpbb_root_path . 'config.'.$phpEx);
-if (defined('DEBUG_EXTRA'))
-{
- $base_memory_usage = 0;
- if (function_exists('memory_get_usage'))
+ if (!defined('PHPBB_INSTALLED'))
{
- $base_memory_usage = memory_get_usage();
+ header('Location: install/index.'.$phpEx);
+ exit;
}
-}
-// Load Extensions
-if (!empty($load_extensions))
-{
- $load_extensions = explode(',', $load_extensions);
+ if (defined('DEBUG_EXTRA'))
+ {
+ $base_memory_usage = 0;
+ if (function_exists('memory_get_usage'))
+ {
+ $base_memory_usage = memory_get_usage();
+ }
+ }
- foreach ($load_extensions as $extension)
+ // Load Extensions
+ if (!empty($load_extensions))
{
- @dl(trim($extension));
+ $load_extensions = explode(',', $load_extensions);
+
+ foreach ($load_extensions as $extension)
+ {
+ @dl(trim($extension));
+ }
}
}
+else
+{
+ $acm_type = 'file';
+}
// Include files
require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx);
require($phpbb_root_path . 'includes/acm/acm_main.' . $phpEx);
-require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
require($phpbb_root_path . 'includes/template.' . $phpEx);
require($phpbb_root_path . 'includes/session.' . $phpEx);
require($phpbb_root_path . 'includes/auth.' . $phpEx);
@@ -149,22 +156,28 @@ $user = new user();
$auth = new auth();
$template = new template();
$cache = new cache();
-$db = new $sql_db();
-// Connect to DB
-$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
+// Initiate DBAL if not installing
+if (!defined('IN_INSTALL'))
+{
+ require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
+ $db = new $sql_db();
-// We do not need this any longer, unset for safety purposes
-unset($dbpasswd);
+ // Connect to DB
+ $db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
-// Grab global variables, re-cache if necessary
-$config = $cache->obtain_config();
-$dss_seeded = false;
+ // We do not need this any longer, unset for safety purposes
+ unset($dbpasswd);
-// Warn about install/ directory
-if (file_exists('install'))
-{
-// trigger_error('REMOVE_INSTALL');
+ // Grab global variables, re-cache if necessary
+ $config = $cache->obtain_config();
+ $dss_seeded = false;
+
+ // Warn about install/ directory
+ if (file_exists('install'))
+ {
+ // trigger_error('REMOVE_INSTALL');
+ }
}
-?>
+?> \ No newline at end of file
diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php
index 2d6dd04da2..7e31bea815 100644
--- a/phpBB/includes/constants.php
+++ b/phpBB/includes/constants.php
@@ -129,6 +129,15 @@ define('FIELD_BOOL', 4);
define('FIELD_DROPDOWN', 5);
define('FIELD_DATE', 6);
+// Additional constants
+
+
+// Table names - do not set if in installation
+if (defined('IN_INSTALL'))
+{
+ return;
+}
+
// Table names
define('ACL_GROUPS_TABLE', $table_prefix.'auth_groups');
define('ACL_OPTIONS_TABLE', $table_prefix.'auth_options');
@@ -195,6 +204,6 @@ define('POLL_OPTIONS_TABLE', $table_prefix.'poll_results');
define('POLL_VOTES_TABLE', $table_prefix.'poll_voters');
define('ZEBRA_TABLE', $table_prefix.'zebra');
-// Additional constants
+// Additional tables
?> \ No newline at end of file
diff --git a/phpBB/install/index.php b/phpBB/install/index.php
index 5a0ecc7bd0..21387977c1 100755
--- a/phpBB/install/index.php
+++ b/phpBB/install/index.php
@@ -15,73 +15,11 @@ define('IN_INSTALL', true);
$phpbb_root_path = './../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
-
-// 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);
-}
+include($phpbb_root_path . 'common.' . $phpEx);
@set_time_limit(120);
-// 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);
+include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
// Try and load an appropriate language if required
$language = request_var('language', '');
@@ -129,26 +67,14 @@ if (!$language)
}
}
-// 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);
+$user->lang_path = $phpbb_root_path . 'language/' . $language . '/';
+$user->add_lang(array('common', 'acp/common', 'acp/board', 'install', 'posting'));
$mode = request_var('mode', 'overview');
$sub = request_var('sub', '');
-// 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');
+$template->set_custom_template($phpbb_root_path . 'adm/style', 'admin');
+$template->assign_var('T_TEMPLATE_PATH', $phpbb_root_path . 'adm/style');
$install = new module();
@@ -269,26 +195,26 @@ class module
{
return;
}
-
define('HEADER_INC', true);
- global $template, $lang, $stage;
+
+ global $template, $user, $stage;
$template->assign_vars(array(
- 'L_INSTALL_PANEL' => $lang['INSTALL_PANEL'],
+ 'L_INSTALL_PANEL' => $user->lang['INSTALL_PANEL'],
'PAGE_TITLE' => $this->get_page_title(),
'META' => $this->get_meta(),
- 'S_CONTENT_DIRECTION' => $lang['DIRECTION'],
- 'S_CONTENT_ENCODING' => $lang['ENCODING'],
- 'S_CONTENT_DIR_LEFT' => $lang['LEFT'],
- 'S_CONTENT_DIR_RIGHT' => $lang['RIGHT'],
+ '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'],
)
);
- if (!empty($lang['ENCODING']))
+ if (!empty($user->lang['ENCODING']))
{
- header('Content-type: text/html; charset: ' . $lang['ENCODING']);
+ header('Content-type: text/html; charset: ' . $user->lang['ENCODING']);
}
header('Cache-Control: private, no-cache="set-cookie", pre-check=0, post-check=0');
header('Expires: 0');
@@ -328,14 +254,14 @@ class module
*/
function get_page_title()
{
- global $lang;
+ global $user;
if (!isset($this->module->page_title))
{
return '';
}
- return (isset($lang[$this->module->page_title])) ? $lang[$this->module->page_title] : $this->module->page_title;
+ return (isset($user->lang[$this->module->page_title])) ? $user->lang[$this->module->page_title] : $this->module->page_title;
}
/**
@@ -351,7 +277,7 @@ class module
*/
function generate_navigation()
{
- global $lang, $template, $phpEx;
+ global $user, $template, $phpEx;
if (is_array($this->module_ary))
{
@@ -359,7 +285,7 @@ class module
foreach ($this->module_ary as $cat_ary)
{
$cat = $cat_ary['name'];
- $l_cat = (!empty($lang['CAT_' . $cat])) ? $lang['CAT_' . $cat] : preg_replace('#_#', ' ', $cat);
+ $l_cat = (!empty($user->lang['CAT_' . $cat])) ? $user->lang['CAT_' . $cat] : preg_replace('#_#', ' ', $cat);
$cat = strtolower($cat);
$url = $this->module_url . '?mode=' . $cat;
@@ -376,7 +302,7 @@ class module
$subs = $this->module_ary[$this->id]['subs'];
foreach ($subs as $option)
{
- $l_option = (!empty($lang['SUB_' . $option])) ? $lang['SUB_' . $option] : preg_replace('#_#', ' ', $option);
+ $l_option = (!empty($user->lang['SUB_' . $option])) ? $user->lang['SUB_' . $option] : preg_replace('#_#', ' ', $option);
$option = strtolower($option);
$url = $this->module_url . '?mode=' . $this->mode . '&amp;sub=' . $option;
@@ -394,7 +320,7 @@ class module
$matched = false;
foreach ($subs as $option)
{
- $l_option = (!empty($lang['STAGE_' . $option])) ? $lang['STAGE_' . $option] : preg_replace('#_#', ' ', $option);
+ $l_option = (!empty($user->lang['STAGE_' . $option])) ? $user->lang['STAGE_' . $option] : preg_replace('#_#', ' ', $option);
$option = strtolower($option);
$matched = ($this->sub == $option) ? true : $matched;
@@ -425,7 +351,7 @@ class module
*/
function error($error, $line, $file, $skip = false)
{
- global $lang, $db;
+ global $user, $db;
if (!$skip)
{
@@ -433,7 +359,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>' . $lang['INST_ERR_FATAL'] . '</title>';
+ echo '<title>' . $user->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">';
@@ -444,10 +370,10 @@ class module
echo ' <div class="panel">';
echo ' <span class="corners-top"><span></span></span>';
echo ' <div id="content">';
- echo ' <h1>' . $lang['INST_ERR_FATAL'] . '</h1>';
+ echo ' <h1>' . $user->lang['INST_ERR_FATAL'] . '</h1>';
}
- echo ' <p>' . $lang['INST_ERR_FATAL'] . "</p>\n";
+ echo ' <p>' . $user->lang['INST_ERR_FATAL'] . "</p>\n";
echo ' <p>' . basename($file) . ' [ ' . $line . " ]</p>\n";
echo ' <p><b>' . $error . "</b></p>\n";
@@ -481,12 +407,12 @@ class module
*/
function db_error($error, $sql, $line, $file, $skip = false)
{
- global $lang, $db;
+ global $user, $db;
$this->page_header();
- echo ' <h2 style="color:red;text-align:center">' . $lang['INST_ERR_FATAL'] . "</h2>\n";
- echo ' <p>' . $lang['INST_ERR_FATAL_DB'] . "</p>\n";
+ 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 ' <p>' . basename($file) . ' [ ' . $line . " ]</p>\n";
echo ' <p>SQL : ' . $sql . "</p>\n";
echo ' <p><b>' . $error . "</b></p>\n";
@@ -506,7 +432,7 @@ class module
*/
function input_field($name, $type, $value='', $options='')
{
- global $lang;
+ global $user;
$tpl_type = explode(':', $type);
$tpl = '';
@@ -534,8 +460,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" />&nbsp;' . (($type_no) ? $lang['NO'] : $lang['DISABLED']);
- $tpl_yes = '<input type="radio" name="' . $name . '" value="1"' . $key_yes . ' class="radio" />&nbsp;' . (($type_no) ? $lang['YES'] : $lang['ENABLED']);
+ $tpl_no = '<input type="radio" name="' . $name . '" value="0"' . $key_no . ' class="radio" />&nbsp;' . (($type_no) ? $user->lang['NO'] : $user->lang['DISABLED']);
+ $tpl_yes = '<input type="radio" name="' . $name . '" value="1"' . $key_yes . ' class="radio" />&nbsp;' . (($type_no) ? $user->lang['YES'] : $user->lang['ENABLED']);
$tpl = ($tpl_type_cond[0] == 'yes' || $tpl_type_cond[0] == 'enabled') ? $tpl_yes . '&nbsp;&nbsp;' . $tpl_no : $tpl_no . '&nbsp;&nbsp;' . $tpl_yes;
break;
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index 116fc7f2f6..1e3163cabe 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 $lang, $template;
+ global $user, $template;
switch ($sub)
{
case 'intro' :
- $this->page_title = $lang['SUB_INTRO'];
+ $this->page_title = $user->lang['SUB_INTRO'];
$template->assign_vars(array(
- 'TITLE' => $lang['INSTALL_INTRO'],
- 'BODY' => $lang['INSTALL_INTRO_BODY'],
- 'L_SUBMIT' => $lang['NEXT'],
+ 'TITLE' => $user->lang['INSTALL_INTRO'],
+ 'BODY' => $user->lang['INSTALL_INTRO_BODY'],
+ 'L_SUBMIT' => $user->lang['NEXT'],
'U_ACTION' => $this->p_master->module_url . "?mode=$mode&amp;sub=requirements",
));
@@ -89,13 +89,13 @@ class install_install extends module
*/
function check_server_requirements($mode, $sub)
{
- global $lang, $template, $phpbb_root_path, $phpEx;
+ global $user, $template, $phpbb_root_path, $phpEx;
- $this->page_title = $lang['STAGE_REQUIREMENTS'];
+ $this->page_title = $user->lang['STAGE_REQUIREMENTS'];
$template->assign_vars(array(
- 'TITLE' => $lang['REQUIREMENTS_TITLE'],
- 'BODY' => $lang['REQUIREMENTS_EXPLAIN'],
+ 'TITLE' => $user->lang['REQUIREMENTS_TITLE'],
+ 'BODY' => $user->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' => $lang['PHP_SETTINGS'],
- 'LEGEND_EXPLAIN' => $lang['PHP_SETTINGS_EXPLAIN'],
+ 'LEGEND' => $user->lang['PHP_SETTINGS'],
+ 'LEGEND_EXPLAIN' => $user->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">' . $lang['NO'] . '</b>';
+ $result = '<b style="color:red">' . $user->lang['NO'] . '</b>';
}
else
{
$passed['php'] = true;
// We also give feedback on whether we're running in safe mode
- $result = '<b style="color:green">' . $lang['YES'];
+ $result = '<b style="color:green">' . $user->lang['YES'];
if (@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'on')
{
- $result .= ', ' . $lang['PHP_SAFE_MODE'];
+ $result .= ', ' . $user->lang['PHP_SAFE_MODE'];
}
$result .= '</b>';
}
$template->assign_block_vars('checks', array(
- 'TITLE' => $lang['PHP_VERSION_REQD'],
+ 'TITLE' => $user->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">' . $lang['NO'] . '</b>';
+ $result = '<b style="color:red">' . $user->lang['NO'] . '</b>';
}
else
{
- $result = '<b style="color:green">' . $lang['YES'] . '</b>';
+ $result = '<b style="color:green">' . $user->lang['YES'] . '</b>';
}
$template->assign_block_vars('checks', array(
- 'TITLE' => $lang['PHP_REGISTER_GLOBALS'],
- 'TITLE_EXPLAIN' => $lang['PHP_REGISTER_GLOBALS_EXPLAIN'],
+ 'TITLE' => $user->lang['PHP_REGISTER_GLOBALS'],
+ 'TITLE_EXPLAIN' => $user->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' => $lang['PHP_SUPPORTED_DB'],
- 'LEGEND_EXPLAIN' => $lang['PHP_SUPPORTED_DB_EXPLAIN'],
+ 'LEGEND' => $user->lang['PHP_SUPPORTED_DB'],
+ 'LEGEND_EXPLAIN' => $user->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' => $lang['DLL_' . strtoupper($db_name)],
- 'RESULT' => '<b style="color:red">' . $lang['UNAVAILABLE'] . '</b>',
+ 'TITLE' => $user->lang['DLL_' . strtoupper($db_name)],
+ 'RESULT' => '<b style="color:red">' . $user->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' => $lang['DLL_' . strtoupper($db_name)],
- 'RESULT' => '<b style="color:green">' . $lang['AVAILABLE'] . '</b>',
+ 'TITLE' => $user->lang['DLL_' . strtoupper($db_name)],
+ 'RESULT' => '<b style="color:green">' . $user->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' => $lang['PHP_OPTIONAL_MODULE'],
- 'LEGEND_EXPLAIN' => $lang['PHP_OPTIONAL_MODULE_EXPLAIN'],
+ 'LEGEND' => $user->lang['PHP_OPTIONAL_MODULE'],
+ 'LEGEND_EXPLAIN' => $user->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' => $lang['DLL_' . strtoupper($dll)],
- 'RESULT' => '<b style="color:red">' . $lang['UNAVAILABLE'] . '</b>',
+ 'TITLE' => $user->lang['DLL_' . strtoupper($dll)],
+ 'RESULT' => '<b style="color:red">' . $user->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' => $lang['DLL_' . strtoupper($dll)],
- 'RESULT' => '<b style="color:green">' . $lang['AVAILABLE'] . '</b>',
+ 'TITLE' => $user->lang['DLL_' . strtoupper($dll)],
+ 'RESULT' => '<b style="color:green">' . $user->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' => $lang['APP_MAGICK'],
- 'RESULT' => ($img_imagick) ? '<b style="color:green">' . $lang['AVAILABLE'] . ', ' . $img_imagick . '</b>' : '<b style="color:blue">' . $lang['NO_LOCATION'] . '</b>',
+ '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>',
'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' => $lang['FILES_REQUIRED'],
- 'LEGEND_EXPLAIN' => $lang['FILES_REQUIRED_EXPLAIN'],
+ 'LEGEND' => $user->lang['FILES_REQUIRED'],
+ 'LEGEND_EXPLAIN' => $user->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">' . $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>' : '');
+ $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>' : '');
$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' => $lang['FILES_OPTIONAL'],
- 'LEGEND_EXPLAIN' => $lang['FILES_OPTIONAL_EXPLAIN'],
+ 'LEGEND' => $user->lang['FILES_OPTIONAL'],
+ 'LEGEND_EXPLAIN' => $user->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">' . $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>' : '');
+ $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>' : '');
$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&amp;sub=database" : $this->p_master->module_url . "?mode=$mode&amp;sub=requirements";
- $submit = ($passed['php'] && $passed['db'] && $passed['files']) ? $lang['INSTALL_START'] : $lang['INSTALL_TEST'];
+ $submit = ($passed['php'] && $passed['db'] && $passed['files']) ? $user->lang['INSTALL_START'] : $user->lang['INSTALL_TEST'];
$template->assign_vars(array(
@@ -359,9 +359,9 @@ class install_install extends module
*/
function obtain_database_settings($mode, $sub)
{
- global $lang, $template, $phpEx;
+ global $user, $template, $phpEx;
- $this->page_title = $lang['STAGE_DATABASE'];
+ $this->page_title = $user->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'][] = $lang['INST_ERR_NO_DB'];;
+ $error['db'][] = $user->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' => $lang['DB_CONNECTION'],
+ 'LEGEND' => $user->lang['DB_CONNECTION'],
'LEGEND_EXPLAIN' => false,
));
if ($connect_test)
{
$template->assign_block_vars('checks', array(
- 'TITLE' => $lang['DB_TEST'],
- 'RESULT' => '<b style="color:green">' . $lang['SUCCESSFUL_CONNECT'] . '</b>',
+ 'TITLE' => $user->lang['DB_TEST'],
+ 'RESULT' => '<b style="color:green">' . $user->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' => $lang['DB_TEST'],
+ 'TITLE' => $user->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' => $lang[$vars])
+ 'LEGEND' => $user->lang[$vars])
);
continue;
@@ -457,10 +457,10 @@ class install_install extends module
$template->assign_block_vars('options', array(
'KEY' => $config_key,
- 'TITLE' => $lang[$vars['lang']],
+ 'TITLE' => $user->lang[$vars['lang']],
'S_EXPLAIN' => $vars['explain'],
'S_LEGEND' => false,
- 'TITLE_EXPLAIN' => ($vars['explain']) ? $lang[$vars['lang'] . '_EXPLAIN'] : '',
+ 'TITLE_EXPLAIN' => ($vars['explain']) ? $user->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&amp;sub=database";
- $submit = $lang['NEXT_STEP'];
+ $submit = $user->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 $lang, $template, $phpEx;
+ global $user, $template, $phpEx;
- $this->page_title = $lang['STAGE_ADMINISTRATOR'];
+ $this->page_title = $user->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[] = $lang['INST_ERR_MISSING_DATA'];
+ $error[] = $user->lang['INST_ERR_MISSING_DATA'];
}
if ($admin_pass1 != $admin_pass2 && $admin_pass1 != '')
{
- $error[] = $lang['INST_ERR_PASSWORD_MISMATCH'];
+ $error[] = $user->lang['INST_ERR_PASSWORD_MISMATCH'];
}
// Test against the default password rules
if ($admin_pass1 != '' && strlen($admin_pass1) < 6)
{
- $error[] = $lang['INST_ERR_PASSWORD_TOO_SHORT'];
+ $error[] = $user->lang['INST_ERR_PASSWORD_TOO_SHORT'];
}
if ($admin_pass1 != '' && strlen($admin_pass1) > 30)
{
- $error[] = $lang['INST_ERR_PASSWORD_TOO_LONG'];
+ $error[] = $user->lang['INST_ERR_PASSWORD_TOO_LONG'];
}
if ($board_email1 != $board_email2 && $board_email1 != '')
{
- $error[] = $lang['INST_ERR_EMAIL_MISMATCH'];
+ $error[] = $user->lang['INST_ERR_EMAIL_MISMATCH'];
}
if ($board_email1 != '' && !preg_match('#^[a-z0-9\.\-_\+]+?@(.*?\.)*?[a-z0-9\-_]+?\.[a-z]{2,4}$#i', $board_email1))
{
- $error[] = $lang['INST_ERR_EMAIL_INVALID'];
+ $error[] = $user->lang['INST_ERR_EMAIL_INVALID'];
}
$template->assign_block_vars('checks', array(
'S_LEGEND' => true,
'S_FIRST_ROW' => true,
- 'LEGEND' => $lang['STAGE_ADMINISTRATOR'],
+ 'LEGEND' => $user->lang['STAGE_ADMINISTRATOR'],
'LEGEND_EXPLAIN' => false,
));
@@ -560,8 +560,8 @@ class install_install extends module
{
$passed = true;
$template->assign_block_vars('checks', array(
- 'TITLE' => $lang['ADMIN_TEST'],
- 'RESULT' => '<b style="color:green">' . $lang['TESTS_PASSED'] . '</b>',
+ 'TITLE' => $user->lang['ADMIN_TEST'],
+ 'RESULT' => '<b style="color:green">' . $user->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' => $lang['ADMIN_TEST'],
+ 'TITLE' => $user->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' => $lang[$vars])
+ 'LEGEND' => $user->lang[$vars])
);
continue;
@@ -602,10 +602,10 @@ class install_install extends module
$template->assign_block_vars('options', array(
'KEY' => $config_key,
- 'TITLE' => $lang[$vars['lang']],
+ 'TITLE' => $user->lang[$vars['lang']],
'S_EXPLAIN' => $vars['explain'],
'S_LEGEND' => false,
- 'TITLE_EXPLAIN' => ($vars['explain']) ? $lang[$vars['lang'] . '_EXPLAIN'] : '',
+ 'TITLE_EXPLAIN' => ($vars['explain']) ? $user->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 = $lang['NEXT_STEP'];
+ $submit = $user->lang['NEXT_STEP'];
$url = ($passed) ? $this->p_master->module_url . "?mode=$mode&amp;sub=config_file" : $this->p_master->module_url . "?mode=$mode&amp;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 $lang, $template, $phpbb_root_path, $phpEx;
+ global $user, $template, $phpbb_root_path, $phpEx;
- $this->page_title = $lang['STAGE_CONFIG_FILE'];
+ $this->page_title = $user->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' => $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'],
+ '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'],
'S_HIDDEN' => $s_hidden_fields,
'S_SHOW_DOWNLOAD' => true,
'U_ACTION' => $this->p_master->module_url . "?mode=$mode&amp;sub=config_file",
@@ -772,8 +772,8 @@ class install_install extends module
else
{
$template->assign_vars(array(
- 'BODY' => $lang['CONFIG_FILE_WRITTEN'],
- 'L_SUBMIT' => $lang['NEXT_STEP'],
+ 'BODY' => $user->lang['CONFIG_FILE_WRITTEN'],
+ 'L_SUBMIT' => $user->lang['NEXT_STEP'],
'S_HIDDEN' => $s_hidden_fields,
'U_ACTION' => $this->p_master->module_url . "?mode=$mode&amp;sub=advanced",
));
@@ -787,9 +787,9 @@ class install_install extends module
*/
function obtain_advanced_settings($mode, $sub)
{
- global $lang, $template, $phpEx;
+ global $user, $template, $phpEx;
- $this->page_title = $lang['STAGE_ADVANCED'];
+ $this->page_title = $user->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' => $lang[$vars])
+ 'LEGEND' => $user->lang[$vars])
);
continue;
@@ -824,10 +824,10 @@ class install_install extends module
$template->assign_block_vars('options', array(
'KEY' => $config_key,
- 'TITLE' => $lang[$vars['lang']],
+ 'TITLE' => $user->lang[$vars['lang']],
'S_EXPLAIN' => $vars['explain'],
'S_LEGEND' => false,
- 'TITLE_EXPLAIN' => ($vars['explain']) ? $lang[$vars['lang'] . '_EXPLAIN'] : '',
+ 'TITLE_EXPLAIN' => ($vars['explain']) ? $user->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 = $lang['NEXT_STEP'];
+ $submit = $user->lang['NEXT_STEP'];
// $url = ($passed) ? $this->p_master->module_url . "?mode=$mode&amp;sub=final" : $this->p_master->module_url . "?mode=$mode&amp;sub=advanced";
// $s_hidden_fields .= ($passed) ? '' : '<input type="hidden" name="check" value="true" />';
$url = $this->p_master->module_url . "?mode=$mode&amp;sub=final";
$template->assign_vars(array(
- 'BODY' => $lang['STAGE_ADVANCED_EXPLAIN'],
+ 'BODY' => $user->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, $lang, $template, $phpbb_root_path, $phpEx;
+ global $db, $user, $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, $lang, $template, $user, $SID, $phpbb_root_path, $phpEx;
+ global $auth, $config, $db, $user, $template, $user, $SID, $phpbb_root_path, $phpEx;
- $this->page_title = $lang['STAGE_FINAL'];
+ $this->page_title = $user->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' => $lang['INSTALL_CONGRATS'],
- 'BODY' => sprintf($lang['INSTALL_CONGRATS_EXPLAIN'], '<a href="../docs/README.html" target="_blank">', '</a>'),
- 'L_SUBMIT' => $lang['INSTALL_LOGIN'],
+ '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'],
'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, $lang;
+ global $phpbb_root_path, $phpEx, $config, $user;
// 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[] = $lang['INST_ERR_DB_CONNECT'] . '<br />' . (($db_error['message']) ? $db_error['message'] : $lang['INST_ERR_DB_NO_ERROR']);
+ $error[] = $user->lang['INST_ERR_DB_CONNECT'] . '<br />' . (($db_error['message']) ? $db_error['message'] : $user->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[] = $lang['INST_ERR_PREFIX'];
+ $error[] = $user->lang['INST_ERR_PREFIX'];
break;
}
}
@@ -1322,14 +1322,14 @@ class install_install extends module
*/
function mail_auth_select($selected_method)
{
- global $lang;
+ global $user;
$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"' : '') . '>' . $lang['SMTP_' . str_replace('-', '_', $method)] . '</option>';
+ $s_smtp_auth_options .= '<option value="' . $method . '"' . (($selected_method == $method) ? ' selected="selected"' : '') . '>' . $user->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 ce81df92db..c8801f77ba 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 $lang, $template;
+ global $user, $template;
switch ($sub)
{
case 'intro' :
- $title = $lang['SUB_INTRO'];
- $body = $lang['OVERVIEW_BODY'];
+ $title = $user->lang['SUB_INTRO'];
+ $body = $user->lang['OVERVIEW_BODY'];
break;
case 'license' :
- $title = $lang['GPL'];
+ $title = $user->lang['GPL'];
$body = implode("<br/>\n", file('../docs/COPYING'));
break;
case 'support' :
- $title = $lang['SUB_SUPPORT'];
- $body = $lang['SUPPORT_BODY'];
+ $title = $user->lang['SUB_SUPPORT'];
+ $body = $user->lang['SUPPORT_BODY'];
break;
}
@@ -60,4 +60,48 @@ 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