aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/adm/style/acp_jabber.html15
-rw-r--r--phpBB/common.php5
-rw-r--r--phpBB/config/default/container/services_console.yml12
-rw-r--r--phpBB/config/default/container/services_cron.yml14
-rw-r--r--phpBB/config/default/container/services_password.yml7
-rw-r--r--phpBB/docs/events.md14
-rw-r--r--phpBB/includes/acp/acp_jabber.php25
-rw-r--r--phpBB/includes/functions_jabber.php53
-rw-r--r--phpBB/includes/functions_messenger.php38
-rw-r--r--phpBB/includes/mcp/mcp_ban.php5
-rw-r--r--phpBB/includes/mcp/mcp_main.php8
-rw-r--r--phpBB/includes/mcp/mcp_post.php5
-rw-r--r--phpBB/includes/startup.php83
-rw-r--r--phpBB/language/en/acp/board.php38
-rw-r--r--phpBB/language/en/cli.php3
-rw-r--r--phpBB/memberlist.php5
-rw-r--r--phpBB/phpbb/console/command/fixup/update_hashes.php117
-rw-r--r--phpBB/phpbb/cron/task/core/update_hashes.php130
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/add_jabber_ssl_context_config_options.php32
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/update_hashes.php33
-rw-r--r--phpBB/phpbb/files/filespec.php2
-rw-r--r--phpBB/phpbb/help/controller/help.php6
-rw-r--r--phpBB/phpbb/passwords/driver/md5_phpbb2.php2
-rw-r--r--phpBB/posting.php5
-rw-r--r--phpBB/styles/prosilver/template/forumlist_body.html4
-rw-r--r--phpBB/styles/prosilver/template/index_body.html7
-rw-r--r--phpBB/styles/prosilver/template/viewforum_body.html4
-rw-r--r--phpBB/styles/prosilver/template/viewtopic_body.html4
-rw-r--r--phpBB/viewonline.php5
29 files changed, 543 insertions, 138 deletions
diff --git a/phpBB/adm/style/acp_jabber.html b/phpBB/adm/style/acp_jabber.html
index 3c3b895624..e76c9a0323 100644
--- a/phpBB/adm/style/acp_jabber.html
+++ b/phpBB/adm/style/acp_jabber.html
@@ -47,6 +47,21 @@
<dd><label><input type="radio" class="radio" id="jab_use_ssl" name="jab_use_ssl" value="1"<!-- IF JAB_USE_SSL --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="jab_use_ssl" value="0"<!-- IF not JAB_USE_SSL --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
+<dl>
+ <dt><label for="jab_verify_peer">{L_JAB_VERIFY_PEER}{L_COLON}</label><br /><span>{L_JAB_VERIFY_PEER_EXPLAIN}</span></dt>
+ <dd><label><input type="radio" class="radio" id="jab_verify_peer" name="jab_verify_peer" value="1"<!-- IF JAB_VERIFY_PEER --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
+ <label><input type="radio" class="radio" name="jab_verify_peer" value="0"<!-- IF not JAB_VERIFY_PEER --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
+</dl>
+<dl>
+ <dt><label for="jab_verify_peer_name">{L_JAB_VERIFY_PEER_NAME}{L_COLON}</label><br /><span>{L_JAB_VERIFY_PEER_NAME_EXPLAIN}</span></dt>
+ <dd><label><input type="radio" class="radio" id="jab_verify_peer_name" name="jab_verify_peer_name" value="1"<!-- IF JAB_VERIFY_PEER_NAME --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
+ <label><input type="radio" class="radio" name="jab_verify_peer_name" value="0"<!-- IF not JAB_VERIFY_PEER_NAME --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
+</dl>
+<dl>
+ <dt><label for="jab_allow_self_signed">{L_JAB_ALLOW_SELF_SIGNED}{L_COLON}</label><br /><span>{L_JAB_ALLOW_SELF_SIGNED_EXPLAIN}</span></dt>
+ <dd><label><input type="radio" class="radio" id="jab_allow_self_signed" name="jab_allow_self_signed" value="1"<!-- IF JAB_ALLOW_SELF_SIGNED --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
+ <label><input type="radio" class="radio" name="jab_allow_self_signed" value="0"<!-- IF not JAB_ALLOW_SELF_SIGNED --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
+</dl>
<!-- ENDIF -->
<dl>
<dt><label for="jab_package_size">{L_JAB_PACKAGE_SIZE}{L_COLON}</label><br /><span>{L_JAB_PACKAGE_SIZE_EXPLAIN}</span></dt>
diff --git a/phpBB/common.php b/phpBB/common.php
index 70feb55d04..172503f078 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -20,11 +20,6 @@ if (!defined('IN_PHPBB'))
exit;
}
-if (version_compare(PHP_VERSION, '5.4') < 0)
-{
- die('You are running an unsupported PHP version. Please upgrade to PHP 5.4.0 or higher before trying to install or update to phpBB 3.2');
-}
-
require($phpbb_root_path . 'includes/startup.' . $phpEx);
require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
diff --git a/phpBB/config/default/container/services_console.yml b/phpBB/config/default/container/services_console.yml
index e25ab4f03f..282b5abb77 100644
--- a/phpBB/config/default/container/services_console.yml
+++ b/phpBB/config/default/container/services_console.yml
@@ -167,6 +167,18 @@ services:
tags:
- { name: console.command }
+ console.command.fixup.update_hashes:
+ class: phpbb\console\command\fixup\update_hashes
+ arguments:
+ - '@config'
+ - '@user'
+ - '@dbal.conn'
+ - '@passwords.manager'
+ - '@passwords.driver_collection'
+ - '%passwords.algorithms%'
+ tags:
+ - { name: console.command }
+
console.command.reparser.list:
class: phpbb\console\command\reparser\list_all
arguments:
diff --git a/phpBB/config/default/container/services_cron.yml b/phpBB/config/default/container/services_cron.yml
index 0b95a96190..d7f6388536 100644
--- a/phpBB/config/default/container/services_cron.yml
+++ b/phpBB/config/default/container/services_cron.yml
@@ -219,3 +219,17 @@ services:
- [set_reparser, [text_reparser.user_signature]]
tags:
- { name: cron.task }
+
+ cron.task.core.update_hashes:
+ class: phpbb\cron\task\core\update_hashes
+ arguments:
+ - '@config'
+ - '@dbal.conn'
+ - '@passwords.update.lock'
+ - '@passwords.manager'
+ - '@passwords.driver_collection'
+ - '%passwords.algorithms%'
+ calls:
+ - [set_name, [cron.task.core.update_hashes]]
+ tags:
+ - { name: cron.task }
diff --git a/phpBB/config/default/container/services_password.yml b/phpBB/config/default/container/services_password.yml
index c276365c56..d5f5fe287b 100644
--- a/phpBB/config/default/container/services_password.yml
+++ b/phpBB/config/default/container/services_password.yml
@@ -127,3 +127,10 @@ services:
- '@passwords.driver_helper'
tags:
- { name: passwords.driver }
+
+ passwords.update.lock:
+ class: phpbb\lock\db
+ arguments:
+ - update_hashes_lock
+ - '@config'
+ - '@dbal.conn'
diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md
index 12f8e6d1b1..ef40e5f434 100644
--- a/phpBB/docs/events.md
+++ b/phpBB/docs/events.md
@@ -694,6 +694,20 @@ forumlist_body_last_post_title_prepend
* Since: 3.1.0-a1
* Purpose: Add content before the post title of the latest post in a forum on the forum list.
+forumlist_body_subforum_link_append
+===
+* Locations:
+ + styles/prosilver/template/forumlist_body.html
+* Since: 3.1.11-RC1
+* Purpose: Add content at the end of subforum link item.
+
+forumlist_body_subforum_link_prepend
+===
+* Locations:
+ + styles/prosilver/template/forumlist_body.html
+* Since: 3.1.11-RC1
+* Purpose: Add content at the start of subforum link item.
+
forumlist_body_subforums_after
===
* Locations:
diff --git a/phpBB/includes/acp/acp_jabber.php b/phpBB/includes/acp/acp_jabber.php
index 5dec6bb7d4..07f5dadbff 100644
--- a/phpBB/includes/acp/acp_jabber.php
+++ b/phpBB/includes/acp/acp_jabber.php
@@ -49,13 +49,16 @@ class acp_jabber
$this->tpl_name = 'acp_jabber';
$this->page_title = 'ACP_JABBER_SETTINGS';
- $jab_enable = $request->variable('jab_enable', (bool) $config['jab_enable']);
- $jab_host = $request->variable('jab_host', (string) $config['jab_host']);
- $jab_port = $request->variable('jab_port', (int) $config['jab_port']);
- $jab_username = $request->variable('jab_username', (string) $config['jab_username']);
- $jab_password = $request->variable('jab_password', (string) $config['jab_password']);
- $jab_package_size = $request->variable('jab_package_size', (int) $config['jab_package_size']);
- $jab_use_ssl = $request->variable('jab_use_ssl', (bool) $config['jab_use_ssl']);
+ $jab_enable = $request->variable('jab_enable', (bool) $config['jab_enable']);
+ $jab_host = $request->variable('jab_host', (string) $config['jab_host']);
+ $jab_port = $request->variable('jab_port', (int) $config['jab_port']);
+ $jab_username = $request->variable('jab_username', (string) $config['jab_username']);
+ $jab_password = $request->variable('jab_password', (string) $config['jab_password']);
+ $jab_package_size = $request->variable('jab_package_size', (int) $config['jab_package_size']);
+ $jab_use_ssl = $request->variable('jab_use_ssl', (bool) $config['jab_use_ssl']);
+ $jab_verify_peer = $request->variable('jab_verify_peer', (bool) $config['jab_verify_peer']);
+ $jab_verify_peer_name = $request->variable('jab_verify_peer_name', (bool) $config['jab_verify_peer_name']);
+ $jab_allow_self_signed = $request->variable('jab_allow_self_signed', (bool) $config['jab_allow_self_signed']);
$form_name = 'acp_jabber';
add_form_key($form_name);
@@ -73,7 +76,7 @@ class acp_jabber
// Is this feature enabled? Then try to establish a connection
if ($jab_enable)
{
- $jabber = new jabber($jab_host, $jab_port, $jab_username, $jab_password, $jab_use_ssl);
+ $jabber = new jabber($jab_host, $jab_port, $jab_username, $jab_password, $jab_use_ssl, $jab_verify_peer, $jab_verify_peer_name, $jab_allow_self_signed);
if (!$jabber->connect())
{
@@ -113,6 +116,9 @@ class acp_jabber
}
$config->set('jab_package_size', $jab_package_size);
$config->set('jab_use_ssl', $jab_use_ssl);
+ $config->set('jab_verify_peer', $jab_verify_peer);
+ $config->set('jab_verify_peer_name', $jab_verify_peer_name);
+ $config->set('jab_allow_self_signed', $jab_allow_self_signed);
$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_' . $log);
trigger_error($message . adm_back_link($this->u_action));
@@ -128,6 +134,9 @@ class acp_jabber
'JAB_PASSWORD' => $jab_password !== '' ? '********' : '',
'JAB_PACKAGE_SIZE' => $jab_package_size,
'JAB_USE_SSL' => $jab_use_ssl,
+ 'JAB_VERIFY_PEER' => $jab_verify_peer,
+ 'JAB_VERIFY_PEER_NAME' => $jab_verify_peer_name,
+ 'JAB_ALLOW_SELF_SIGNED' => $jab_allow_self_signed,
'S_CAN_USE_SSL' => jabber::can_use_ssl(),
'S_GTALK_NOTE' => (!@function_exists('dns_get_record')) ? true : false,
));
diff --git a/phpBB/includes/functions_jabber.php b/phpBB/includes/functions_jabber.php
index a38888a861..cfe8c2a90e 100644
--- a/phpBB/includes/functions_jabber.php
+++ b/phpBB/includes/functions_jabber.php
@@ -41,6 +41,9 @@ class jabber
var $username;
var $password;
var $use_ssl;
+ var $verify_peer;
+ var $verify_peer_name;
+ var $allow_self_signed;
var $resource = 'functions_jabber.phpbb.php';
var $enable_logging;
@@ -49,8 +52,18 @@ class jabber
var $features = array();
/**
+ * Constructor
+ *
+ * @param string $server Jabber server
+ * @param int $port Jabber server port
+ * @param string $username Jabber username or JID
+ * @param string $password Jabber password
+ * @param boold $use_ssl Use ssl
+ * @param bool $verify_peer Verify SSL certificate
+ * @param bool $verify_peer_name Verify Jabber peer name
+ * @param bool $allow_self_signed Allow self signed certificates
*/
- function jabber($server, $port, $username, $password, $use_ssl = false)
+ function __construct($server, $port, $username, $password, $use_ssl = false, $verify_peer = true, $verify_peer_name = true, $allow_self_signed = false)
{
$this->connect_server = ($server) ? $server : 'localhost';
$this->port = ($port) ? $port : 5222;
@@ -71,6 +84,9 @@ class jabber
$this->password = $password;
$this->use_ssl = ($use_ssl && self::can_use_ssl()) ? true : false;
+ $this->verify_peer = $verify_peer;
+ $this->verify_peer_name = $verify_peer_name;
+ $this->allow_self_signed = $allow_self_signed;
// Change port if we use SSL
if ($this->port == 5222 && $this->use_ssl)
@@ -95,7 +111,7 @@ class jabber
*/
static public function can_use_tls()
{
- if (!@extension_loaded('openssl') || !function_exists('stream_socket_enable_crypto') || !function_exists('stream_get_meta_data') || !function_exists('socket_set_blocking') || !function_exists('stream_get_wrappers'))
+ if (!@extension_loaded('openssl') || !function_exists('stream_socket_enable_crypto') || !function_exists('stream_get_meta_data') || !function_exists('stream_set_blocking') || !function_exists('stream_get_wrappers'))
{
return false;
}
@@ -138,7 +154,7 @@ class jabber
$this->session['ssl'] = $this->use_ssl;
- if ($this->open_socket($this->connect_server, $this->port, $this->use_ssl))
+ if ($this->open_socket($this->connect_server, $this->port, $this->use_ssl, $this->verify_peer, $this->verify_peer_name, $this->allow_self_signed))
{
$this->send("<?xml version='1.0' encoding='UTF-8' ?" . ">\n");
$this->send("<stream:stream to='{$this->server}' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>\n");
@@ -226,10 +242,13 @@ class jabber
* @param string $server host to connect to
* @param int $port port number
* @param bool $use_ssl use ssl or not
+ * @param bool $verify_peer verify ssl certificate
+ * @param bool $verify_peer_name verify peer name
+ * @param bool $allow_self_signed allow self-signed ssl certificates
* @access public
* @return bool
*/
- function open_socket($server, $port, $use_ssl = false)
+ function open_socket($server, $port, $use_ssl, $verify_peer, $verify_peer_name, $allow_self_signed)
{
if (@function_exists('dns_get_record'))
{
@@ -240,12 +259,26 @@ class jabber
}
}
- $server = $use_ssl ? 'ssl://' . $server : $server;
+ $options = array();
- if ($this->connection = @fsockopen($server, $port, $errorno, $errorstr, $this->timeout))
+ if ($use_ssl)
{
- socket_set_blocking($this->connection, 0);
- socket_set_timeout($this->connection, 60);
+ $remote_socket = 'ssl://' . $server . ':' . $port;
+
+ // Set ssl context options, see http://php.net/manual/en/context.ssl.php
+ $options['ssl'] = array('verify_peer' => $verify_peer, 'verify_peer_name' => $verify_peer_name, 'allow_self_signed' => $allow_self_signed);
+ }
+ else
+ {
+ $remote_socket = $server . ':' . $port;
+ }
+
+ $socket_context = stream_context_create($options);
+
+ if ($this->connection = @stream_socket_client($remote_socket, $errorno, $errorstr, $this->timeout, STREAM_CLIENT_CONNECT, $socket_context))
+ {
+ stream_set_blocking($this->connection, 0);
+ stream_set_timeout($this->connection, 60);
return true;
}
@@ -562,7 +595,7 @@ class jabber
case 'proceed':
// continue switching to TLS
$meta = stream_get_meta_data($this->connection);
- socket_set_blocking($this->connection, 1);
+ stream_set_blocking($this->connection, 1);
if (!stream_socket_enable_crypto($this->connection, true, STREAM_CRYPTO_METHOD_TLS_CLIENT))
{
@@ -570,7 +603,7 @@ class jabber
return false;
}
- socket_set_blocking($this->connection, $meta['blocked']);
+ stream_set_blocking($this->connection, $meta['blocked']);
$this->session['tls'] = true;
// new stream
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index 802246c1c5..ab7f00a65a 100644
--- a/phpBB/includes/functions_messenger.php
+++ b/phpBB/includes/functions_messenger.php
@@ -306,10 +306,16 @@ class messenger
/**
* Send the mail out to the recipients set previously in var $this->addresses
+ *
+ * @param int $method User notification method NOTIFY_EMAIL|NOTIFY_IM|NOTIFY_BOTH
+ * @param bool $break Flag indicating if the function only formats the subject
+ * and the message without sending it
+ *
+ * @return bool
*/
function send($method = NOTIFY_EMAIL, $break = false)
{
- global $config, $user;
+ global $config, $user, $phpbb_dispatcher;
// We add some standard variables we always use, no need to specify them always
$this->assign_vars(array(
@@ -318,6 +324,30 @@ class messenger
'SITENAME' => htmlspecialchars_decode($config['sitename']),
));
+ $subject = $this->subject;
+ $message = $this->msg;
+ /**
+ * Event to modify notification message text before parsing
+ *
+ * @event core.modify_notification_message
+ * @var int method User notification method NOTIFY_EMAIL|NOTIFY_IM|NOTIFY_BOTH
+ * @var bool break Flag indicating if the function only formats the subject
+ * and the message without sending it
+ * @var string subject The message subject
+ * @var string message The message text
+ * @since 3.1.11-RC1
+ */
+ $vars = array(
+ 'method',
+ 'break',
+ 'subject',
+ 'message',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.modify_notification_message', compact($vars)));
+ $this->subject = $subject;
+ $this->msg = $message;
+ unset($subject, $message);
+
// Parse message through template
$this->msg = trim($this->template->assign_display('body'));
@@ -618,7 +648,7 @@ class messenger
if (!$use_queue)
{
include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);
- $this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], htmlspecialchars_decode($config['jab_password']), $config['jab_use_ssl']);
+ $this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], htmlspecialchars_decode($config['jab_password']), $config['jab_use_ssl'], $config['jab_verify_peer'], $config['jab_verify_peer_name'], $config['jab_allow_self_signed']);
if (!$this->jabber->connect())
{
@@ -818,7 +848,7 @@ class queue
}
include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);
- $this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], htmlspecialchars_decode($config['jab_password']), $config['jab_use_ssl']);
+ $this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], htmlspecialchars_decode($config['jab_password']), $config['jab_use_ssl'], $config['jab_verify_peer'], $config['jab_verify_peer_name'], $config['jab_allow_self_signed']);
if (!$this->jabber->connect())
{
@@ -1089,7 +1119,7 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $headers = false)
$options['ssl'] = array('verify_peer' => $verify_peer, 'verify_peer_name' => $verify_peer_name, 'allow_self_signed' => $allow_self_signed);
$socket_context = stream_context_create($options);
- $smtp->socket = stream_socket_client($remote_socket, $errno, $errstr, 20, STREAM_CLIENT_CONNECT, $socket_context);
+ $smtp->socket = @stream_socket_client($remote_socket, $errno, $errstr, 20, STREAM_CLIENT_CONNECT, $socket_context);
$collector->uninstall();
$error_contents = $collector->format_errors();
diff --git a/phpBB/includes/mcp/mcp_ban.php b/phpBB/includes/mcp/mcp_ban.php
index 4d2151fded..2f3405f915 100644
--- a/phpBB/includes/mcp/mcp_ban.php
+++ b/phpBB/includes/mcp/mcp_ban.php
@@ -28,7 +28,10 @@ class mcp_ban
global $db, $user, $auth, $template, $request, $phpbb_dispatcher;
global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ if (!function_exists('user_ban'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
// Include the admin banning interface...
include($phpbb_root_path . 'includes/acp/acp_ban.' . $phpEx);
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php
index 971982e4fc..3d56bba21c 100644
--- a/phpBB/includes/mcp/mcp_main.php
+++ b/phpBB/includes/mcp/mcp_main.php
@@ -637,10 +637,13 @@ function mcp_move_topic($topic_ids)
*
* @event core.mcp_main_modify_shadow_sql
* @var array shadow SQL array to be used by $db->sql_build_array
+ * @var array row Topic data
* @since 3.1.11-RC1
+ * @changed 3.1.11-RC1 Added variable: row
*/
$vars = array(
'shadow',
+ 'row',
);
extract($phpbb_dispatcher->trigger_event('core.mcp_main_modify_shadow_sql', compact($vars)));
@@ -1343,11 +1346,14 @@ function mcp_fork_topic($topic_ids)
* Perform actions before forked topic is created.
*
* @event core.mcp_main_modify_fork_sql
- * @var array sql_ary SQL array to be used by $db->sql_build_array
+ * @var array sql_ary SQL array to be used by $db->sql_build_array
+ * @var array topic_row Topic data
* @since 3.1.11-RC1
+ * @changed 3.1.11-RC1 Added variable: topic_row
*/
$vars = array(
'sql_ary',
+ 'topic_row',
);
extract($phpbb_dispatcher->trigger_event('core.mcp_main_modify_fork_sql', compact($vars)));
diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php
index dd7aebdbd1..60ec3b8f5a 100644
--- a/phpBB/includes/mcp/mcp_post.php
+++ b/phpBB/includes/mcp/mcp_post.php
@@ -53,7 +53,10 @@ function mcp_post_details($id, $mode, $action)
if ($auth->acl_get('m_info', $post_info['forum_id']))
{
$ip = $request->variable('ip', '');
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ if (!function_exists('user_ipwhois'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
$template->assign_vars(array(
'RETURN_POST' => sprintf($user->lang['RETURN_POST'], '<a href="' . append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;mode=$mode&amp;p=$post_id") . '">', '</a>'),
diff --git a/phpBB/includes/startup.php b/phpBB/includes/startup.php
index 5900016c39..66f85657a5 100644
--- a/phpBB/includes/startup.php
+++ b/phpBB/includes/startup.php
@@ -22,88 +22,15 @@ if (!defined('IN_PHPBB'))
$level = E_ALL & ~E_NOTICE & ~E_DEPRECATED;
error_reporting($level);
-/*
-* Remove variables created by register_globals from the global scope
-* Thanks to Matt Kavanagh
+/**
+* Minimum Requirement: PHP 5.4.0
*/
-function deregister_globals()
+if (version_compare(PHP_VERSION, '5.4') < 0)
{
- $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.
- if (isset($_COOKIE[$varname]))
- {
- echo "Clear your cookies. ";
- }
- echo "Malicious variable name detected. Contact the administrator and ask them to disable register_globals.";
- exit;
- }
-
- unset($GLOBALS[$varname]);
- }
-
- unset($input);
+ die('You are running an unsupported PHP version. Please upgrade to PHP 5.4.0 or higher before trying to install or update to phpBB 3.2');
}
+// Register globals and magic quotes have been dropped in PHP 5.4 so no need for extra checks
-// Register globals and magic quotes have been dropped in PHP 5.4
-if (version_compare(PHP_VERSION, '5.4.0-dev', '>='))
-{
- /**
- * @ignore
- */
- define('STRIP', false);
-}
-else
-{
- if (get_magic_quotes_runtime())
- {
- // Deactivate
- @set_magic_quotes_runtime(0);
- }
-
- // Be paranoid with passed vars
- if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on' || !function_exists('ini_get'))
- {
- deregister_globals();
- }
-
- define('STRIP', (get_magic_quotes_gpc()) ? true : false);
-}
// In PHP 5.3.0 the error level has been raised to E_WARNING which causes problems
// because we show E_WARNING errors and do not set a default timezone.
diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php
index 4b9a50c05e..4db8a02405 100644
--- a/phpBB/language/en/acp/board.php
+++ b/phpBB/language/en/acp/board.php
@@ -602,20 +602,26 @@ $lang = array_merge($lang, array(
$lang = array_merge($lang, array(
'ACP_JABBER_SETTINGS_EXPLAIN' => 'Here you can enable and control the use of Jabber for instant messaging and board notifications. Jabber is an open source protocol and therefore available for use by anyone. Some Jabber servers include gateways or transports which allow you to contact users on other networks. Not all servers offer all transports and changes in protocols can prevent transports from operating. Please be sure to enter already registered account details - phpBB will use the details you enter here as is.',
- 'JAB_ENABLE' => 'Enable Jabber',
- 'JAB_ENABLE_EXPLAIN' => 'Enables use of Jabber messaging and notifications.',
- 'JAB_GTALK_NOTE' => 'Please note that GTalk will not work because the <samp>dns_get_record</samp> function could not be found. This function is not available in PHP4, and is not implemented on Windows platforms. It currently does not work on BSD-based systems, including Mac OS.',
- 'JAB_PACKAGE_SIZE' => 'Jabber package size',
- 'JAB_PACKAGE_SIZE_EXPLAIN' => 'This is the number of messages sent in one package. If set to 0 the message is sent immediately and will not be queued for later sending.',
- 'JAB_PASSWORD' => 'Jabber password',
- 'JAB_PASSWORD_EXPLAIN' => '<em><strong>Warning:</strong> This password will be stored as plain text in the database, visible to everybody who can access your database or who can view this configuration page.</em>',
- 'JAB_PORT' => 'Jabber port',
- 'JAB_PORT_EXPLAIN' => 'Leave blank unless you know it is not port 5222.',
- 'JAB_SERVER' => 'Jabber server',
- 'JAB_SERVER_EXPLAIN' => 'See %sjabber.org%s for a list of servers.',
- 'JAB_SETTINGS_CHANGED' => 'Jabber settings changed successfully.',
- 'JAB_USE_SSL' => 'Use SSL to connect',
- 'JAB_USE_SSL_EXPLAIN' => 'If enabled a secure connection is tried to be established. The Jabber port will be modified to 5223 if port 5222 is specified.',
- 'JAB_USERNAME' => 'Jabber username or JID',
- 'JAB_USERNAME_EXPLAIN' => 'Specify a registered username or a valid JID. The username will not be checked for validity. If you only specify a username, then your JID will be the username and the server you specified above. Else, specify a valid JID, for example user@jabber.org.',
+ 'JAB_ALLOW_SELF_SIGNED' => 'Allow self-signed SSL certificates',
+ 'JAB_ALLOW_SELF_SIGNED_EXPLAIN' => 'Allow connections to Jabber server with self-signed SSL certificate.<em><strong>Warning:</strong> Allowing self-signed SSL certificates may cause security implications.</em>',
+ 'JAB_ENABLE' => 'Enable Jabber',
+ 'JAB_ENABLE_EXPLAIN' => 'Enables use of Jabber messaging and notifications.',
+ 'JAB_GTALK_NOTE' => 'Please note that GTalk will not work because the <samp>dns_get_record</samp> function could not be found. This function is not available in PHP4, and is not implemented on Windows platforms. It currently does not work on BSD-based systems, including Mac OS.',
+ 'JAB_PACKAGE_SIZE' => 'Jabber package size',
+ 'JAB_PACKAGE_SIZE_EXPLAIN' => 'This is the number of messages sent in one package. If set to 0 the message is sent immediately and will not be queued for later sending.',
+ 'JAB_PASSWORD' => 'Jabber password',
+ 'JAB_PASSWORD_EXPLAIN' => '<em><strong>Warning:</strong> This password will be stored as plain text in the database, visible to everybody who can access your database or who can view this configuration page.</em>',
+ 'JAB_PORT' => 'Jabber port',
+ 'JAB_PORT_EXPLAIN' => 'Leave blank unless you know it is not port 5222.',
+ 'JAB_SERVER' => 'Jabber server',
+ 'JAB_SERVER_EXPLAIN' => 'See %sjabber.org%s for a list of servers.',
+ 'JAB_SETTINGS_CHANGED' => 'Jabber settings changed successfully.',
+ 'JAB_USE_SSL' => 'Use SSL to connect',
+ 'JAB_USE_SSL_EXPLAIN' => 'If enabled a secure connection is tried to be established. The Jabber port will be modified to 5223 if port 5222 is specified.',
+ 'JAB_USERNAME' => 'Jabber username or JID',
+ 'JAB_USERNAME_EXPLAIN' => 'Specify a registered username or a valid JID. The username will not be checked for validity. If you only specify a username, then your JID will be the username and the server you specified above. Else, specify a valid JID, for example user@jabber.org.',
+ 'JAB_VERIFY_PEER' => 'Verify SSL certificate',
+ 'JAB_VERIFY_PEER_EXPLAIN' => 'Require verification of SSL certificate used by Jabber server.<em><strong>Warning:</strong> Connecting peers with unverified SSL certificates may cause security implications.</em>',
+ 'JAB_VERIFY_PEER_NAME' => 'Verify Jabber peer name',
+ 'JAB_VERIFY_PEER_NAME_EXPLAIN' => 'Require verification of peer name for Jabber servers using SSL / TLS connections.<em><strong>Warning:</strong> Connecting to unverified peers may cause security implications.</em>',
));
diff --git a/phpBB/language/en/cli.php b/phpBB/language/en/cli.php
index 2f969ceede..1517e0e344 100644
--- a/phpBB/language/en/cli.php
+++ b/phpBB/language/en/cli.php
@@ -91,6 +91,8 @@ $lang = array_merge($lang, array(
'CLI_DESCRIPTION_UPDATE_CHECK_OPTION_CACHE' => 'Run check command with cache.',
'CLI_DESCRIPTION_UPDATE_CHECK_OPTION_STABILITY' => 'Run command choosing to check only stable or unstable versions.',
+ 'CLI_DESCRIPTION_UPDATE_HASH_BCRYPT' => 'Updates outdated password hashes to be hashed with bcrypt.',
+
'CLI_ERROR_INVALID_STABILITY' => '"%s" needs to be set to "stable" or "unstable".',
'CLI_DESCRIPTION_USER_ACTIVATE' => 'Activate (or deactivate) a user account.',
@@ -125,6 +127,7 @@ $lang = array_merge($lang, array(
'CLI_EXTENSIONS_ENABLED' => 'Enabled',
'CLI_FIXUP_RECALCULATE_EMAIL_HASH_SUCCESS' => 'Successfully recalculated all email hashes.',
+ 'CLI_FIXUP_UPDATE_HASH_BCRYPT_SUCCESS' => 'Successfully updated outdated password hashes to bcrypt.',
'CLI_MIGRATION_NAME' => 'Migration name, including the namespace (use forward slashes instead of backslashes to avoid problems).',
'CLI_MIGRATIONS_AVAILABLE' => 'Available migrations',
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index e816e06488..b4bf92836f 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -105,7 +105,10 @@ switch ($mode)
{
case 'team':
// Display a listing of board admins, moderators
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ if (!function_exists('user_get_id_name'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
$page_title = $user->lang['THE_TEAM'];
$template_html = 'memberlist_team.html';
diff --git a/phpBB/phpbb/console/command/fixup/update_hashes.php b/phpBB/phpbb/console/command/fixup/update_hashes.php
new file mode 100644
index 0000000000..4bcc3b5d19
--- /dev/null
+++ b/phpBB/phpbb/console/command/fixup/update_hashes.php
@@ -0,0 +1,117 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+namespace phpbb\console\command\fixup;
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Helper\ProgressBar;
+
+class update_hashes extends \phpbb\console\command\command
+{
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db;
+
+ /** @var \phpbb\passwords\manager */
+ protected $passwords_manager;
+
+ /** @var string Default hashing type */
+ protected $default_type;
+
+ /**
+ * Update_hashes constructor
+ *
+ * @param \phpbb\config\config $config
+ * @param \phpbb\user $user
+ * @param \phpbb\db\driver\driver_interface $db
+ * @param \phpbb\passwords\manager $passwords_manager
+ * @param array $hashing_algorithms Hashing driver
+ * service collection
+ * @param array $defaults Default password types
+ */
+ public function __construct(\phpbb\config\config $config, \phpbb\user $user,
+ \phpbb\db\driver\driver_interface $db, \phpbb\passwords\manager $passwords_manager,
+ $hashing_algorithms, $defaults)
+ {
+ $this->config = $config;
+ $this->db = $db;
+
+ $this->passwords_manager = $passwords_manager;
+
+ foreach ($defaults as $type)
+ {
+ if ($hashing_algorithms[$type]->is_supported())
+ {
+ $this->default_type = $type;
+ break;
+ }
+ }
+
+ parent::__construct($user);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function configure()
+ {
+ $this
+ ->setName('fixup:update-hashes')
+ ->setDescription($this->user->lang('CLI_DESCRIPTION_UPDATE_HASH_BCRYPT'))
+ ;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ // Get count to be able to display progress
+ $sql = 'SELECT COUNT(user_id) AS count
+ FROM ' . USERS_TABLE . '
+ WHERE user_password ' . $this->db->sql_like_expression('$H$' . $this->db->get_any_char()) . '
+ OR user_password ' . $this->db->sql_like_expression('$CP$' . $this->db->get_any_char());
+ $result = $this->db->sql_query($sql);
+ $total_update_passwords = $this->db->sql_fetchfield('count');
+ $this->db->sql_freeresult($result);
+
+ // Create progress bar
+ $progress_bar = new ProgressBar($output, $total_update_passwords);
+ $progress_bar->start();
+
+ $sql = 'SELECT user_id, user_password
+ FROM ' . USERS_TABLE . '
+ WHERE user_password ' . $this->db->sql_like_expression('$H$' . $this->db->get_any_char()) . '
+ OR user_password ' . $this->db->sql_like_expression('$CP$' . $this->db->get_any_char());
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $new_hash = $this->passwords_manager->hash($row['user_password'], array($this->default_type));
+
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_password = "' . $this->db->sql_escape($new_hash) . '"
+ WHERE user_id = ' . (int) $row['user_id'];
+ $this->db->sql_query($sql);
+ $progress_bar->advance();
+ }
+
+ $this->config->set('update_hashes_last_cron', time());
+
+ $progress_bar->finish();
+
+ $output->writeln('<info>' . $this->user->lang('CLI_FIXUP_UPDATE_HASH_BCRYPT_SUCCESS') . '</info>');
+ }
+}
diff --git a/phpBB/phpbb/cron/task/core/update_hashes.php b/phpBB/phpbb/cron/task/core/update_hashes.php
new file mode 100644
index 0000000000..a4fe477d99
--- /dev/null
+++ b/phpBB/phpbb/cron/task/core/update_hashes.php
@@ -0,0 +1,130 @@
+<?php
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+namespace phpbb\cron\task\core;
+
+/**
+ * Update old hashes to the current default hashing algorithm
+ *
+ * It is intended to gradually update all "old" style hashes to the
+ * current default hashing algorithm.
+ */
+class update_hashes extends \phpbb\cron\task\base
+{
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db;
+
+ /** @var \phpbb\lock\db */
+ protected $update_lock;
+
+ /** @var \phpbb\passwords\manager */
+ protected $passwords_manager;
+
+ /** @var string Default hashing type */
+ protected $default_type;
+
+ /**
+ * Constructor.
+ *
+ * @param \phpbb\config\config $config
+ * @param \phpbb\db\driver\driver_interface $db
+ * @param \phpbb\lock\db $update_lock
+ * @param \phpbb\passwords\manager $passwords_manager
+ * @param array $hashing_algorithms Hashing driver
+ * service collection
+ * @param array $defaults Default password types
+ */
+ public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\lock\db $update_lock, \phpbb\passwords\manager $passwords_manager, $hashing_algorithms, $defaults)
+ {
+ $this->config = $config;
+ $this->db = $db;
+ $this->passwords_manager = $passwords_manager;
+ $this->update_lock = $update_lock;
+
+ foreach ($defaults as $type)
+ {
+ if ($hashing_algorithms[$type]->is_supported())
+ {
+ $this->default_type = $type;
+ break;
+ }
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_runnable()
+ {
+ return !$this->config['use_system_cron'];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function should_run()
+ {
+ if (!empty($this->config['update_hashes_lock']))
+ {
+ $last_run = explode(' ', $this->config['update_hashes_lock']);
+ if ($last_run[0] + 60 >= time())
+ {
+ return false;
+ }
+ }
+
+ return $this->config['enable_update_hashes'] && $this->config['update_hashes_last_cron'] < (time() - 60);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function run()
+ {
+ if ($this->update_lock->acquire())
+ {
+ $sql = 'SELECT user_id, user_password
+ FROM ' . USERS_TABLE . '
+ WHERE user_password ' . $this->db->sql_like_expression('$H$' . $this->db->get_any_char()) . '
+ OR user_password ' . $this->db->sql_like_expression('$CP$' . $this->db->get_any_char());
+ $result = $this->db->sql_query_limit($sql, 20);
+
+ $affected_rows = 0;
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $new_hash = $this->passwords_manager->hash($row['user_password'], array($this->default_type));
+
+ // Increase number so we know that users were selected from the database
+ $affected_rows++;
+
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_password = "' . $this->db->sql_escape($new_hash) . '"
+ WHERE user_id = ' . (int) $row['user_id'];
+ $this->db->sql_query($sql);
+ }
+
+ $this->config->set('update_hashes_last_cron', time());
+ $this->update_lock->release();
+
+ // Stop cron for good once all hashes are converted
+ if ($affected_rows === 0)
+ {
+ $this->config->set('enable_update_hashes', '0');
+ }
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/add_jabber_ssl_context_config_options.php b/phpBB/phpbb/db/migration/data/v31x/add_jabber_ssl_context_config_options.php
new file mode 100644
index 0000000000..9f416fe069
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/add_jabber_ssl_context_config_options.php
@@ -0,0 +1,32 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class add_jabber_ssl_context_config_options extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v31x\v3110');
+ }
+
+ public function update_data()
+ {
+ return array(
+ // See http://php.net/manual/en/context.ssl.php
+ array('config.add', array('jab_verify_peer', 1)),
+ array('config.add', array('jab_verify_peer_name', 1)),
+ array('config.add', array('jab_allow_self_signed', 0)),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/update_hashes.php b/phpBB/phpbb/db/migration/data/v31x/update_hashes.php
new file mode 100644
index 0000000000..aa83c3ffbf
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/update_hashes.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+namespace phpbb\db\migration\data\v31x;
+
+class update_hashes extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v3110',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.add', array('enable_update_hashes', '1')),
+ array('config.add', array('update_hashes_lock', '')),
+ array('config.add', array('update_hashes_last_cron', '0'))
+ );
+ }
+}
diff --git a/phpBB/phpbb/files/filespec.php b/phpBB/phpbb/files/filespec.php
index 2ff2a92c83..f1a32ef4a8 100644
--- a/phpBB/phpbb/files/filespec.php
+++ b/phpBB/phpbb/files/filespec.php
@@ -129,7 +129,7 @@ class filespec
$this->class_initialized = true;
$this->filename = $upload_ary['tmp_name'];
$this->filesize = $upload_ary['size'];
- $name = (STRIP) ? stripslashes($upload_ary['name']) : $upload_ary['name'];
+ $name = $upload_ary['name'];
$name = trim(utf8_basename($name));
$this->realname = $this->uploadname = $name;
$this->mimetype = $upload_ary['type'];
diff --git a/phpBB/phpbb/help/controller/help.php b/phpBB/phpbb/help/controller/help.php
index 9cc3b0c8b4..3bf6fe3098 100644
--- a/phpBB/phpbb/help/controller/help.php
+++ b/phpBB/phpbb/help/controller/help.php
@@ -64,6 +64,7 @@ class help
*/
public function handle($mode)
{
+ $template_file = 'faq_body.html';
switch ($mode)
{
case 'faq':
@@ -85,13 +86,16 @@ class help
* @var string lang_file Language file containing the help data
* @var string ext_name Vendor and extension name where the help
* language file can be loaded from
+ * @var string template_file Template file name
* @since 3.1.4-RC1
+ * @changed 3.1.11-RC1 Added template_file var
*/
$vars = array(
'page_title',
'mode',
'lang_file',
'ext_name',
+ 'template_file',
);
extract($this->dispatcher->trigger_event('core.faq_mode_validation', compact($vars)));
@@ -113,7 +117,7 @@ class help
$this->assign_to_template($this->user->help);
make_jumpbox(append_sid("{$this->root_path}viewforum.{$this->php_ext}"));
- return $this->helper->render('faq_body.html', $page_title);
+ return $this->helper->render($template_file, $page_title);
}
/**
diff --git a/phpBB/phpbb/passwords/driver/md5_phpbb2.php b/phpBB/phpbb/passwords/driver/md5_phpbb2.php
index bd8cc51e5a..b38b041d6c 100644
--- a/phpBB/phpbb/passwords/driver/md5_phpbb2.php
+++ b/phpBB/phpbb/passwords/driver/md5_phpbb2.php
@@ -95,7 +95,7 @@ class md5_phpbb2 extends base
// in phpBB2 passwords were used exactly as they were sent, with addslashes applied
$password_old_format = isset($_REQUEST['password']) ? (string) $_REQUEST['password'] : '';
- $password_old_format = (!STRIP) ? addslashes($password_old_format) : $password_old_format;
+ $password_old_format = addslashes($password_old_format);
$password_new_format = $this->request->variable('password', '', true);
if ($super_globals_disabled)
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 6d4c3cb395..0b6b9c5969 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -1073,7 +1073,10 @@ if ($submit || $preview || $refresh)
// Validate username
if (($post_data['username'] && !$user->data['is_registered']) || ($mode == 'edit' && $post_data['poster_id'] == ANONYMOUS && $post_data['username'] && $post_data['post_username'] && $post_data['post_username'] != $post_data['username']))
{
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ if (!function_exists('validate_username'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
$user->add_lang('ucp');
diff --git a/phpBB/styles/prosilver/template/forumlist_body.html b/phpBB/styles/prosilver/template/forumlist_body.html
index 4ab6de250f..621e226260 100644
--- a/phpBB/styles/prosilver/template/forumlist_body.html
+++ b/phpBB/styles/prosilver/template/forumlist_body.html
@@ -52,8 +52,8 @@
<!-- EVENT forumlist_body_subforums_before -->
<br /><strong>{forumrow.L_SUBFORUM_STR}{L_COLON}</strong>
<!-- BEGIN subforum -->
- <a href="{forumrow.subforum.U_SUBFORUM}" class="subforum<!-- IF forumrow.subforum.S_UNREAD --> unread<!-- ELSE --> read<!-- ENDIF -->" title="<!-- IF forumrow.subforum.S_UNREAD -->{L_UNREAD_POSTS}<!-- ELSE -->{L_NO_UNREAD_POSTS}<!-- ENDIF -->">
- <i class="icon <!-- IF forumrow.subforum.IS_LINK -->fa-external-link<!-- ELSE -->fa-file-o<!-- ENDIF --> fa-fw <!-- IF forumrow.subforum.S_UNREAD --> icon-red<!-- ELSE --> icon-blue<!-- ENDIF --> icon-md" aria-hidden="true"></i>{forumrow.subforum.SUBFORUM_NAME}</a><!-- IF not forumrow.subforum.S_LAST_ROW -->{L_COMMA_SEPARATOR}<!-- ENDIF -->
+ <!-- EVENT forumlist_body_subforum_link_prepend --><a href="{forumrow.subforum.U_SUBFORUM}" class="subforum<!-- IF forumrow.subforum.S_UNREAD --> unread<!-- ELSE --> read<!-- ENDIF -->" title="<!-- IF forumrow.subforum.S_UNREAD -->{L_UNREAD_POSTS}<!-- ELSE -->{L_NO_UNREAD_POSTS}<!-- ENDIF -->">
+ <i class="icon <!-- IF forumrow.subforum.IS_LINK -->fa-external-link<!-- ELSE -->fa-file-o<!-- ENDIF --> fa-fw <!-- IF forumrow.subforum.S_UNREAD --> icon-red<!-- ELSE --> icon-blue<!-- ENDIF --> icon-md" aria-hidden="true"></i>{forumrow.subforum.SUBFORUM_NAME}</a><!-- IF not forumrow.subforum.S_LAST_ROW -->{L_COMMA_SEPARATOR}<!-- ENDIF --><!-- EVENT forumlist_body_subforum_link_append -->
<!-- END subforum -->
<!-- EVENT forumlist_body_subforums_after -->
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/index_body.html b/phpBB/styles/prosilver/template/index_body.html
index b4febd1d49..b292c40eb2 100644
--- a/phpBB/styles/prosilver/template/index_body.html
+++ b/phpBB/styles/prosilver/template/index_body.html
@@ -40,8 +40,11 @@
<!-- IF U_VIEWONLINE --><h3><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a></h3><!-- ELSE --><h3>{L_WHO_IS_ONLINE}</h3><!-- ENDIF -->
<p>
<!-- EVENT index_body_block_online_prepend -->
- {TOTAL_USERS_ONLINE} ({L_ONLINE_EXPLAIN})<br />{RECORD_USERS}<br /> <br />{LOGGED_IN_USER_LIST}
- <!-- IF LEGEND --><br /><em>{L_LEGEND}{L_COLON} {LEGEND}</em><!-- ENDIF -->
+ {TOTAL_USERS_ONLINE} ({L_ONLINE_EXPLAIN})<br />{RECORD_USERS}<br />
+ <!-- IF U_VIEWONLINE -->
+ <br />{LOGGED_IN_USER_LIST}
+ <!-- IF LEGEND --><br /><em>{L_LEGEND}{L_COLON} {LEGEND}</em><!-- ENDIF -->
+ <!-- ENDIF -->
<!-- EVENT index_body_block_online_append -->
</p>
</div>
diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html
index 867fd84112..b57f48ba15 100644
--- a/phpBB/styles/prosilver/template/viewforum_body.html
+++ b/phpBB/styles/prosilver/template/viewforum_body.html
@@ -289,9 +289,9 @@
<!-- INCLUDE jumpbox.html -->
-<!-- IF S_DISPLAY_ONLINE_LIST -->
+<!-- IF S_DISPLAY_ONLINE_LIST and U_VIEWONLINE -->
<div class="stat-block online-list">
- <h3><!-- IF U_VIEWONLINE --><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a><!-- ELSE -->{L_WHO_IS_ONLINE}<!-- ENDIF --></h3>
+ <h3><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a></h3>
<p>{LOGGED_IN_USER_LIST}</p>
</div>
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html
index 522151cf7d..71d364bbb9 100644
--- a/phpBB/styles/prosilver/template/viewtopic_body.html
+++ b/phpBB/styles/prosilver/template/viewtopic_body.html
@@ -439,9 +439,9 @@
<!-- EVENT viewtopic_body_footer_before -->
<!-- INCLUDE jumpbox.html -->
-<!-- IF S_DISPLAY_ONLINE_LIST -->
+<!-- IF S_DISPLAY_ONLINE_LIST and U_VIEWONLINE -->
<div class="stat-block online-list">
- <h3><!-- IF U_VIEWONLINE --><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a><!-- ELSE -->{L_WHO_IS_ONLINE}<!-- ENDIF --></h3>
+ <h3><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a></h3>
<p>{LOGGED_IN_USER_LIST}</p>
</div>
<!-- ENDIF -->
diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php
index 624fe4ca9c..d5ddb0ba13 100644
--- a/phpBB/viewonline.php
+++ b/phpBB/viewonline.php
@@ -64,7 +64,10 @@ $order_by = $sort_key_sql[$sort_key] . ' ' . (($sort_dir == 'a') ? 'ASC' : 'DESC
// Whois requested
if ($mode == 'whois' && $auth->acl_get('a_') && $session_id)
{
- include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ if (!function_exists('user_get_id_name'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
$sql = 'SELECT u.user_id, u.username, u.user_type, s.session_ip
FROM ' . USERS_TABLE . ' u, ' . SESSIONS_TABLE . " s