aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/common.php181
-rw-r--r--phpBB/includes/constants.php142
-rw-r--r--phpBB/includes/functions_messenger.php9
-rw-r--r--phpBB/includes/session.php34
-rwxr-xr-xphpBB/install/index.php136
-rwxr-xr-xphpBB/install/install_install.php192
-rwxr-xr-xphpBB/install/install_main.php56
-rw-r--r--phpBB/language/en/posting.php2
8 files changed, 365 insertions, 387 deletions
diff --git a/phpBB/common.php b/phpBB/common.php
index b037d87ea9..d8307713fe 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -23,61 +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);
-
-/**
-* Remove variables created by register_globals from the global scope
-* Thanks to Matt Kavanagh
-*/
-function deregister_globals()
-{
- $not_unset = array(
- 'GLOBALS' => true,
- '_GET' => true,
- '_POST' => true,
- '_COOKIE' => true,
- '_REQUEST' => true,
- '_SERVER' => true,
- '_SESSION' => true,
- '_ENV' => true,
- '_FILES' => true,
- 'phpEx' => true,
- 'phpbb_root_path' => true);
-
- // Not only will array_merge and array_keys give a warning if
- // a parameter is not an array, array_merge 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(
- array_keys($_GET),
- array_keys($_POST),
- array_keys($_COOKIE),
- array_keys($_SERVER),
- array_keys($_SESSION),
- array_keys($_ENV),
- array_keys($_FILES)
- );
-
- foreach ($input as $varname)
- {
- if (isset($not_unset[$varname]))
- {
- // Hacking attempt. No point in continuing.
- exit;
- }
-
- unset($GLOBALS[$varname]);
- }
-
- unset($input);
-}
+error_reporting(E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables
+//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-dev', '>='))
@@ -91,7 +38,54 @@ else
// Be paranoid with passed vars
if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on')
{
- deregister_globals();
+ // Remove variables created by register_globals from the global scope
+ // Thanks to Matt Kavanagh
+ $not_unset = array(
+ 'GLOBALS' => true,
+ '_GET' => true,
+ '_POST' => true,
+ '_COOKIE' => true,
+ '_REQUEST' => true,
+ '_SERVER' => true,
+ '_SESSION' => true,
+ '_ENV' => true,
+ '_FILES' => true,
+ 'phpEx' => true,
+ 'phpbb_root_path' => true
+ );
+
+ // Not only will array_merge and array_keys give a warning if
+ // a parameter is not an array, array_merge 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(
+ array_keys($_GET),
+ array_keys($_POST),
+ array_keys($_COOKIE),
+ array_keys($_SERVER),
+ array_keys($_SESSION),
+ array_keys($_ENV),
+ array_keys($_FILES)
+ );
+
+ foreach ($input as $varname)
+ {
+ if (isset($not_unset[$varname]))
+ {
+ // Hacking attempt. No point in continuing.
+ exit;
+ }
+
+ unset($GLOBALS[$varname]);
+ }
+
+ unset($input);
}
define('STRIP', (get_magic_quotes_gpc()) ? true : false);
@@ -103,41 +97,33 @@ if (defined('IN_CRON'))
$phpbb_root_path = getcwd() . '/';
}
-// Run the following code if not currently installing
-if (!defined('IN_INSTALL'))
+require($phpbb_root_path . 'config.'.$phpEx);
+
+if (!defined('PHPBB_INSTALLED'))
{
- require($phpbb_root_path . 'config.'.$phpEx);
+ header('Location: install/index.'.$phpEx);
+ exit;
+}
- if (!defined('PHPBB_INSTALLED'))
+if (defined('DEBUG_EXTRA'))
+{
+ $base_memory_usage = 0;
+ if (function_exists('memory_get_usage'))
{
- header('Location: install/index.'.$phpEx);
- exit;
+ $base_memory_usage = memory_get_usage();
}
+}
- if (defined('DEBUG_EXTRA'))
- {
- $base_memory_usage = 0;
- if (function_exists('memory_get_usage'))
- {
- $base_memory_usage = memory_get_usage();
- }
- }
+// Load Extensions
+if (!empty($load_extensions))
+{
+ $load_extensions = explode(',', $load_extensions);
- // Load Extensions
- if (!empty($load_extensions))
+ foreach ($load_extensions as $extension)
{
- $load_extensions = explode(',', $load_extensions);
-
- foreach ($load_extensions as $extension)
- {
- @dl(trim($extension));
- }
+ @dl(trim($extension));
}
}
-else
-{
- $acm_type = 'file';
-}
// Include files
require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx);
@@ -147,6 +133,7 @@ require($phpbb_root_path . 'includes/session.' . $phpEx);
require($phpbb_root_path . 'includes/auth.' . $phpEx);
require($phpbb_root_path . 'includes/functions.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);
+require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
// Set PHP error handler to ours
set_error_handler('msg_handler');
@@ -156,28 +143,22 @@ $user = new user();
$auth = new auth();
$template = new template();
$cache = new cache();
+$db = new $sql_db();
-// Initiate DBAL if not installing
-if (!defined('IN_INSTALL'))
-{
- require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
- $db = new $sql_db();
-
- // Connect to DB
- $db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
+// Connect to DB
+$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
- // We do not need this any longer, unset for safety purposes
- unset($dbpasswd);
+// We do not need this any longer, unset for safety purposes
+unset($dbpasswd);
- // Grab global variables, re-cache if necessary
- $config = $cache->obtain_config();
- $dss_seeded = false;
+// 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');
- }
+// 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 da19cfde4d..75b3c9ef02 100644
--- a/phpBB/includes/constants.php
+++ b/phpBB/includes/constants.php
@@ -132,79 +132,73 @@ define('FIELD_DATE', 6);
// Additional constants
-// Table names - only set if not in installation
-if (!defined('IN_INSTALL'))
-{
- // Table names
- define('ACL_GROUPS_TABLE', $table_prefix . 'auth_groups');
- define('ACL_OPTIONS_TABLE', $table_prefix . 'auth_options');
- define('ACL_ROLES_TABLE', $table_prefix . 'auth_roles');
- define('ACL_ROLES_DATA_TABLE', $table_prefix . 'auth_roles_data');
- define('ACL_USERS_TABLE', $table_prefix . 'auth_users');
- define('ATTACHMENTS_TABLE', $table_prefix . 'attachments');
- define('BANLIST_TABLE', $table_prefix . 'banlist');
- define('BBCODES_TABLE', $table_prefix . 'bbcodes');
- define('BOOKMARKS_TABLE', $table_prefix . 'bookmarks');
- define('BOTS_TABLE', $table_prefix . 'bots');
- define('CACHE_TABLE', $table_prefix . 'cache');
- define('CONFIG_TABLE', $table_prefix . 'config');
- define('CONFIRM_TABLE', $table_prefix . 'confirm');
- define('PROFILE_FIELDS_TABLE', $table_prefix . 'profile_fields');
- define('PROFILE_LANG_TABLE', $table_prefix . 'profile_lang');
- define('PROFILE_DATA_TABLE', $table_prefix . 'profile_fields_data');
- define('PROFILE_FIELDS_LANG_TABLE', $table_prefix . 'profile_fields_lang');
- define('DISALLOW_TABLE', $table_prefix . 'disallow');
- define('DRAFTS_TABLE', $table_prefix . 'drafts');
- define('EXTENSIONS_TABLE', $table_prefix . 'extensions');
- define('EXTENSION_GROUPS_TABLE', $table_prefix . 'extension_groups');
- define('FORUMS_TABLE', $table_prefix . 'forums');
- define('FORUMS_ACCESS_TABLE', $table_prefix . 'forum_access');
- define('FORUMS_TRACK_TABLE', $table_prefix . 'forums_marking');
- define('FORUMS_WATCH_TABLE', $table_prefix . 'forums_watch');
- define('GROUPS_TABLE', $table_prefix . 'groups');
- define('ICONS_TABLE', $table_prefix . 'icons');
- define('LANG_TABLE', $table_prefix . 'lang');
- define('LOG_TABLE', $table_prefix . 'log');
- define('MODERATOR_TABLE', $table_prefix . 'moderator_cache');
- define('MODULES_TABLE', $table_prefix . 'modules');
- define('POSTS_TABLE', $table_prefix . 'posts');
- define('PRIVMSGS_TABLE', $table_prefix . 'privmsgs');
- define('PRIVMSGS_TO_TABLE', $table_prefix . 'privmsgs_to');
- define('PRIVMSGS_FOLDER_TABLE', $table_prefix . 'privmsgs_folder');
- define('PRIVMSGS_RULES_TABLE', $table_prefix . 'privmsgs_rules');
- define('RANKS_TABLE', $table_prefix . 'ranks');
- define('RATINGS_TABLE', $table_prefix . 'ratings');
- define('REPORTS_TABLE', $table_prefix . 'reports');
- define('REASONS_TABLE', $table_prefix . 'reports_reasons');
- define('SEARCH_TABLE', $table_prefix . 'search_results');
- define('SEARCH_WORD_TABLE', $table_prefix . 'search_wordlist');
- define('SEARCH_MATCH_TABLE', $table_prefix . 'search_wordmatch');
- define('SESSIONS_TABLE', $table_prefix . 'sessions');
- define('SESSIONS_KEYS_TABLE', $table_prefix . 'sessions_keys');
- define('SITELIST_TABLE', $table_prefix . 'sitelist');
- define('SMILIES_TABLE', $table_prefix . 'smilies');
- define('STYLES_TABLE', $table_prefix . 'styles');
- define('STYLES_TPL_TABLE', $table_prefix . 'styles_template');
- define('STYLES_TPLDATA_TABLE', $table_prefix . 'styles_template_data');
- define('STYLES_CSS_TABLE', $table_prefix . 'styles_theme');
- define('STYLES_IMAGE_TABLE', $table_prefix . 'styles_imageset');
- define('TOPICS_TABLE', $table_prefix . 'topics');
- define('TOPICS_POSTED_TABLE', $table_prefix . 'topics_posted');
- define('TOPICS_WATCH_TABLE', $table_prefix . 'topics_watch');
- define('TOPICS_TRACK_TABLE', $table_prefix . 'topics_marking');
- define('USER_GROUP_TABLE', $table_prefix . 'user_group');
- define('USERS_TABLE', $table_prefix . 'users');
- define('USERS_NOTES_TABLE', $table_prefix . 'users_notes');
- define('WARNINGS_TABLE', $table_prefix . 'warnings');
- define('WORDS_TABLE', $table_prefix . 'words');
- define('POLL_OPTIONS_TABLE', $table_prefix . 'poll_results');
- define('POLL_VOTES_TABLE', $table_prefix . 'poll_voters');
- define('ZEBRA_TABLE', $table_prefix . 'zebra');
-
- // Additional tables
-
-
- // Additional tables end
-}
+// Table names
+define('ACL_GROUPS_TABLE', $table_prefix . 'auth_groups');
+define('ACL_OPTIONS_TABLE', $table_prefix . 'auth_options');
+define('ACL_ROLES_TABLE', $table_prefix . 'auth_roles');
+define('ACL_ROLES_DATA_TABLE', $table_prefix . 'auth_roles_data');
+define('ACL_USERS_TABLE', $table_prefix . 'auth_users');
+define('ATTACHMENTS_TABLE', $table_prefix . 'attachments');
+define('BANLIST_TABLE', $table_prefix . 'banlist');
+define('BBCODES_TABLE', $table_prefix . 'bbcodes');
+define('BOOKMARKS_TABLE', $table_prefix . 'bookmarks');
+define('BOTS_TABLE', $table_prefix . 'bots');
+define('CACHE_TABLE', $table_prefix . 'cache');
+define('CONFIG_TABLE', $table_prefix . 'config');
+define('CONFIRM_TABLE', $table_prefix . 'confirm');
+define('PROFILE_FIELDS_TABLE', $table_prefix . 'profile_fields');
+define('PROFILE_LANG_TABLE', $table_prefix . 'profile_lang');
+define('PROFILE_DATA_TABLE', $table_prefix . 'profile_fields_data');
+define('PROFILE_FIELDS_LANG_TABLE', $table_prefix . 'profile_fields_lang');
+define('DISALLOW_TABLE', $table_prefix . 'disallow');
+define('DRAFTS_TABLE', $table_prefix . 'drafts');
+define('EXTENSIONS_TABLE', $table_prefix . 'extensions');
+define('EXTENSION_GROUPS_TABLE', $table_prefix . 'extension_groups');
+define('FORUMS_TABLE', $table_prefix . 'forums');
+define('FORUMS_ACCESS_TABLE', $table_prefix . 'forum_access');
+define('FORUMS_TRACK_TABLE', $table_prefix . 'forums_marking');
+define('FORUMS_WATCH_TABLE', $table_prefix . 'forums_watch');
+define('GROUPS_TABLE', $table_prefix . 'groups');
+define('ICONS_TABLE', $table_prefix . 'icons');
+define('LANG_TABLE', $table_prefix . 'lang');
+define('LOG_TABLE', $table_prefix . 'log');
+define('MODERATOR_TABLE', $table_prefix . 'moderator_cache');
+define('MODULES_TABLE', $table_prefix . 'modules');
+define('POSTS_TABLE', $table_prefix . 'posts');
+define('PRIVMSGS_TABLE', $table_prefix . 'privmsgs');
+define('PRIVMSGS_TO_TABLE', $table_prefix . 'privmsgs_to');
+define('PRIVMSGS_FOLDER_TABLE', $table_prefix . 'privmsgs_folder');
+define('PRIVMSGS_RULES_TABLE', $table_prefix . 'privmsgs_rules');
+define('RANKS_TABLE', $table_prefix . 'ranks');
+define('RATINGS_TABLE', $table_prefix . 'ratings');
+define('REPORTS_TABLE', $table_prefix . 'reports');
+define('REASONS_TABLE', $table_prefix . 'reports_reasons');
+define('SEARCH_TABLE', $table_prefix . 'search_results');
+define('SEARCH_WORD_TABLE', $table_prefix . 'search_wordlist');
+define('SEARCH_MATCH_TABLE', $table_prefix . 'search_wordmatch');
+define('SESSIONS_TABLE', $table_prefix . 'sessions');
+define('SESSIONS_KEYS_TABLE', $table_prefix . 'sessions_keys');
+define('SITELIST_TABLE', $table_prefix . 'sitelist');
+define('SMILIES_TABLE', $table_prefix . 'smilies');
+define('STYLES_TABLE', $table_prefix . 'styles');
+define('STYLES_TPL_TABLE', $table_prefix . 'styles_template');
+define('STYLES_TPLDATA_TABLE', $table_prefix . 'styles_template_data');
+define('STYLES_CSS_TABLE', $table_prefix . 'styles_theme');
+define('STYLES_IMAGE_TABLE', $table_prefix . 'styles_imageset');
+define('TOPICS_TABLE', $table_prefix . 'topics');
+define('TOPICS_POSTED_TABLE', $table_prefix . 'topics_posted');
+define('TOPICS_WATCH_TABLE', $table_prefix . 'topics_watch');
+define('TOPICS_TRACK_TABLE', $table_prefix . 'topics_marking');
+define('USER_GROUP_TABLE', $table_prefix . 'user_group');
+define('USERS_TABLE', $table_prefix . 'users');
+define('USERS_NOTES_TABLE', $table_prefix . 'users_notes');
+define('WARNINGS_TABLE', $table_prefix . 'warnings');
+define('WORDS_TABLE', $table_prefix . 'words');
+define('POLL_OPTIONS_TABLE', $table_prefix . 'poll_results');
+define('POLL_VOTES_TABLE', $table_prefix . 'poll_voters');
+define('ZEBRA_TABLE', $table_prefix . 'zebra');
+
+// Additional tables
+
?> \ No newline at end of file
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index 8e20a418e2..a314c5edef 100644
--- a/phpBB/includes/functions_messenger.php
+++ b/phpBB/includes/functions_messenger.php
@@ -912,7 +912,10 @@ class smtp_class
// Log into server and get possible auth codes if neccessary
function log_into_server($hostname, $username, $password, $default_auth_method)
{
+ global $user;
+
$err_msg = '';
+ $local_host = (empty($user->page)) ? 'localhost' : $user->host;
// If we are authenticating through pop-before-smtp, we
// have to login ones before we get authenticated
@@ -923,7 +926,7 @@ class smtp_class
}
// Try EHLO first
- $this->server_send("EHLO [$hostname]");
+ $this->server_send("EHLO [{$local_host}]");
if ($err_msg = $this->server_parse('250', __LINE__))
{
// a 503 response code means that we're already authenticated
@@ -933,7 +936,7 @@ class smtp_class
}
// If EHLO fails, we try HELO
- $this->server_send("HELO [$hostname]");
+ $this->server_send("HELO [{$local_host}]");
if ($err_msg = $this->server_parse('250', __LINE__))
{
return ($this->numeric_response_code == 503) ? false : $err_msg;
@@ -1148,7 +1151,7 @@ class smtp_class
$uname = posix_uname();
$tokens['realm'] = $uname['nodename'];
}
-
+
// Maxbuf
if (empty($tokens['maxbuf']))
{
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index 3ea20541ab..cf074bb0c5 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -17,6 +17,7 @@ class session
var $session_id = '';
var $cookie_data = array();
var $browser = '';
+ var $host = '';
var $ip = '';
var $page = array();
var $current_page_filename = '';
@@ -112,6 +113,7 @@ class session
$this->time_now = time();
$this->browser = (!empty($_SERVER['HTTP_USER_AGENT'])) ? $_SERVER['HTTP_USER_AGENT'] : '';
+ $this->host = (!empty($_SERVER['HTTP_HOST'])) ? $_SERVER['HTTP_HOST'] : 'localhost';
$this->page = $this->extract_current_page($phpbb_root_path);
$this->page['page'] .= (isset($_POST['f'])) ? ((strpos($this->page['page'], '?') !== false) ? '&' : '?') . 'f=' . intval($_POST['f']) : '';
@@ -373,10 +375,6 @@ class session
$this->data = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
}
-/* echo "<br />$sql";
- echo "<br />$user_id :: " . sizeof($this->data) . " :: " . (int) is_array($this->data) . " :: " . $db->sql_numrows();
- print_r($this->cookie_data);
- print_r($this->data);*/
// If no data was returned one or more of the following occured:
// Key didn't match one in the DB
@@ -397,34 +395,6 @@ class session
$db->sql_freeresult($result);
}
-/* echo "<br />$sql";
- echo "<br />$user_id :: " . sizeof($this->data) . " :: " . (int) is_array($this->data) . " :: " . $db->sql_numrows();
- print_r($this->cookie_data);
- print_r($this->data);
-
- if ($this->data['user_id'] != ANONYMOUS)
- {
- $sql = 'SELECT session_time, session_id
- FROM ' . SESSIONS_TABLE . '
- WHERE session_user_id = ' . (int) $this->data['user_id'] . '
- ORDER BY session_time DESC';
- $result = $db->sql_query_limit($sql, 1);
-
- if ($sdata = $db->sql_fetchrow($result))
- {
- $this->data = array_merge($sdata, $this->data);
- unset($sdata);
- $this->session_id = $this->data['session_id'];
- }
- $db->sql_freeresult($result);
-
- $this->data['session_last_visit'] = (isset($this->data['session_time']) && $this->data['session_time']) ? $this->data['session_time'] : (($this->data['user_lastvisit']) ? $this->data['user_lastvisit'] : time());
- }
- else
- {
- $this->data['session_last_visit'] = time();
- }
-*/
if ($this->data['user_id'] != ANONYMOUS)
{
$this->data['session_last_visit'] = (isset($this->data['session_time']) && $this->data['session_time']) ? $this->data['session_time'] : (($this->data['user_lastvisit']) ? $this->data['user_lastvisit'] : time());
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 . '&amp;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" />&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_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 = ($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 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&amp;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&amp;sub=database" : $this->p_master->module_url . "?mode=$mode&amp;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&amp;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&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 $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&amp;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&amp;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&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' => $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
diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php
index 3ff773ab20..692c43a3fe 100644
--- a/phpBB/language/en/posting.php
+++ b/phpBB/language/en/posting.php
@@ -39,7 +39,7 @@ $lang = array_merge($lang, array(
'ATTACH_SIG' => 'Attach a signature (signatures can be altered via the UCP)',
'BBCODE_A_HELP' => 'Close all open bbCode tags',
- 'BBCODE_B_HELP' => 'Bold text: [b]text[/b] \' (alt+b)',
+ 'BBCODE_B_HELP' => 'Bold text: [b]text[/b] (alt+b)',
'BBCODE_C_HELP' => 'Code display: [code]code[/code] (alt+c)',
'BBCODE_E_HELP' => 'List: Add list element',
'BBCODE_F_HELP' => 'Font size: [size=x-small]small text[/size]',