aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acp/acp_board.php3
-rw-r--r--phpBB/includes/acp/acp_main.php6
-rw-r--r--phpBB/includes/acp/acp_update.php12
-rw-r--r--phpBB/includes/functions.php24
-rw-r--r--phpBB/includes/functions_content.php29
-rw-r--r--phpBB/includes/functions_download.php2
-rw-r--r--phpBB/includes/functions_messenger.php29
-rw-r--r--phpBB/includes/mcp/mcp_queue.php2
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php28
-rw-r--r--phpBB/includes/ucp/ucp_profile.php39
10 files changed, 153 insertions, 21 deletions
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index f08f5356c8..7e42cc3d26 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -642,6 +642,9 @@ class acp_board
$messenger->template('test');
$messenger->set_addresses($user->data);
$messenger->anti_abuse_headers($config, $user);
+ $messenger->assign_vars(array(
+ 'USERNAME' => htmlspecialchars_decode($user->data['username']),
+ ));
$messenger->send(NOTIFY_EMAIL);
trigger_error($user->lang('TEST_EMAIL_SENT') . adm_back_link($this->u_action));
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php
index 529c3a1835..f44bbbc88d 100644
--- a/phpBB/includes/acp/acp_main.php
+++ b/phpBB/includes/acp/acp_main.php
@@ -459,6 +459,12 @@ class acp_main
$template->assign_var('S_VERSION_UP_TO_DATE', true);
}
+ // Incomplete update?
+ if (phpbb_version_compare($config['version'], PHPBB_VERSION, '<'))
+ {
+ $template->assign_var('S_UPDATE_INCOMPLETE', true);
+ }
+
/**
* Notice admin
*
diff --git a/phpBB/includes/acp/acp_update.php b/phpBB/includes/acp/acp_update.php
index 52897e1043..e42367d8a1 100644
--- a/phpBB/includes/acp/acp_update.php
+++ b/phpBB/includes/acp/acp_update.php
@@ -63,5 +63,17 @@ class acp_update
'UPDATE_INSTRUCTIONS' => sprintf($user->lang['UPDATE_INSTRUCTIONS'], $update_link),
));
+
+ // Incomplete update?
+ if (phpbb_version_compare($config['version'], PHPBB_VERSION, '<'))
+ {
+ $database_update_link = append_sid($phpbb_root_path . 'install/database_update.' . $phpEx);
+
+ $template->assign_vars(array(
+ 'S_UPDATE_INCOMPLETE' => true,
+ 'FILES_VERSION' => PHPBB_VERSION,
+ 'INCOMPLETE_INSTRUCTIONS' => $user->lang('UPDATE_INCOMPLETE_EXPLAIN', $database_update_link),
+ ));
+ }
}
}
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 497403b1e5..588a717f0e 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -3669,6 +3669,30 @@ function obtain_users_online_string($online_users, $item_id = 0, $item = 'forum'
}
}
}
+
+ /**
+ * Modify online userlist data
+ *
+ * @event core.obtain_users_online_string_before_modify
+ * @var array online_users Array with online users data
+ * from obtain_users_online()
+ * @var int item_id Restrict online users to item id
+ * @var string item Restrict online users to a certain
+ * session item, e.g. forum for
+ * session_forum_id
+ * @var array rowset Array with online users data
+ * @var array user_online_link Array with online users items (usernames)
+ * @since 3.1.10-RC1
+ */
+ $vars = array(
+ 'online_users',
+ 'item_id',
+ 'item',
+ 'rowset',
+ 'user_online_link',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.obtain_users_online_string_before_modify', compact($vars)));
+
$online_userlist = implode(', ', $user_online_link);
if (!$online_userlist)
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php
index fd7fc478bd..173ea49acc 100644
--- a/phpBB/includes/functions_content.php
+++ b/phpBB/includes/functions_content.php
@@ -150,7 +150,7 @@ function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key,
*/
function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list = false, $force_display = false)
{
- global $config, $auth, $template, $user, $db, $phpbb_path_helper;
+ global $config, $auth, $template, $user, $db, $phpbb_path_helper, $phpbb_dispatcher;
// We only return if the jumpbox is not forced to be displayed (in case it is needed for functionality)
if (!$config['load_jumpbox'] && $force_display === false)
@@ -205,20 +205,21 @@ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list
continue;
}
+ $tpl_ary = array();
if (!$display_jumpbox)
{
- $template->assign_block_vars('jumpbox_forums', array(
+ $tpl_ary[] = array(
'FORUM_ID' => ($select_all) ? 0 : -1,
'FORUM_NAME' => ($select_all) ? $user->lang['ALL_FORUMS'] : $user->lang['SELECT_FORUM'],
'S_FORUM_COUNT' => $iteration,
'LINK' => $phpbb_path_helper->append_url_params($action, array('f' => $forum_id)),
- ));
+ );
$iteration++;
$display_jumpbox = true;
}
- $template->assign_block_vars('jumpbox_forums', array(
+ $tpl_ary[] = array(
'FORUM_ID' => $row['forum_id'],
'FORUM_NAME' => $row['forum_name'],
'SELECTED' => ($row['forum_id'] == $forum_id) ? ' selected="selected"' : '',
@@ -227,7 +228,25 @@ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list
'S_IS_LINK' => ($row['forum_type'] == FORUM_LINK) ? true : false,
'S_IS_POST' => ($row['forum_type'] == FORUM_POST) ? true : false,
'LINK' => $phpbb_path_helper->append_url_params($action, array('f' => $row['forum_id'])),
- ));
+ );
+
+ /**
+ * Modify the jumpbox before it is assigned to the template
+ *
+ * @event core.make_jumpbox_modify_tpl_ary
+ * @var array row The data of the forum
+ * @var array tpl_ary Template data of the forum
+ * @since 3.1.10-RC1
+ */
+ $vars = array(
+ 'row',
+ 'tpl_ary',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.make_jumpbox_modify_tpl_ary', compact($vars)));
+
+ $template->assign_block_vars_array('jumpbox_forums', $tpl_ary);
+
+ unset($tpl_ary);
for ($i = 0; $i < $padding; $i++)
{
diff --git a/phpBB/includes/functions_download.php b/phpBB/includes/functions_download.php
index b295d4cd1e..1659d4b252 100644
--- a/phpBB/includes/functions_download.php
+++ b/phpBB/includes/functions_download.php
@@ -166,7 +166,7 @@ function send_file_to_browser($attachment, $upload_dir, $category)
}
// Make sure the database record for the filesize is correct
- if ($size > 0 && $size != $attachment['filesize'])
+ if ($size > 0 && $size != $attachment['filesize'] && strpos($attachment['physical_filename'], 'thumb_') === false)
{
// Update database record
$sql = 'UPDATE ' . ATTACHMENTS_TABLE . '
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index 3fa96afb29..10d4910494 100644
--- a/phpBB/includes/functions_messenger.php
+++ b/phpBB/includes/functions_messenger.php
@@ -624,31 +624,34 @@ class messenger
*/
protected function setup_template()
{
- global $phpbb_extension_manager, $phpbb_container, $phpbb_filesystem;
+ global $phpbb_container;
if ($this->template instanceof \phpbb\template\template)
{
return;
}
+ $template_environment = new \phpbb\template\twig\environment(
+ $phpbb_container->get('config'),
+ $phpbb_container->get('filesystem'),
+ $phpbb_container->get('path_helper'),
+ $phpbb_container->getParameter('core.template.cache_path'),
+ $phpbb_container->get('ext.manager'),
+ new \phpbb\template\twig\loader(
+ $phpbb_container->get('filesystem')
+ )
+ );
+ $template_environment->setLexer($phpbb_container->get('template.twig.lexer'));
+
$this->template = new \phpbb\template\twig\twig(
$phpbb_container->get('path_helper'),
$phpbb_container->get('config'),
new \phpbb\template\context(),
- new \phpbb\template\twig\environment(
- $phpbb_container->get('config'),
- $phpbb_container->get('filesystem'),
- $phpbb_container->get('path_helper'),
- $phpbb_container->getParameter('core.cache_dir'),
- $phpbb_container->get('ext.manager'),
- new \phpbb\template\twig\loader(
- $phpbb_filesystem
- )
- ),
- $phpbb_container->getParameter('core.cache_dir'),
+ $template_environment,
+ $phpbb_container->getParameter('core.template.cache_path'),
$phpbb_container->get('user'),
$phpbb_container->get('template.twig.extensions.collection'),
- $phpbb_extension_manager
+ $phpbb_container->get('ext.manager')
);
}
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index bf93593c74..1ccced7a2f 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -104,7 +104,7 @@ class mcp_queue
if (!empty($topic_id_list) && $mode == 'deleted_topics')
{
- if (!function_exists('mcp_delete_topics'))
+ if (!function_exists('mcp_delete_topic'))
{
global $phpbb_root_path, $phpEx;
include($phpbb_root_path . 'includes/mcp/mcp_main.' . $phpEx);
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index 1132271689..ad9a99204f 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -739,6 +739,34 @@ function compose_pm($id, $mode, $action, $user_folders = array())
$enable_urls = (isset($_POST['disable_magic_url'])) ? 0 : 1;
$enable_sig = (!$config['allow_sig'] ||!$config['allow_sig_pm']) ? false : ((isset($_POST['attach_sig'])) ? true : false);
+ /**
+ * Modify private message
+ *
+ * @event core.ucp_pm_compose_modify_parse_before
+ * @var bool enable_bbcode Whether or not bbcode is enabled
+ * @var bool enable_smilies Whether or not smilies are enabled
+ * @var bool enable_urls Whether or not urls are enabled
+ * @var bool enable_sig Whether or not signature is enabled
+ * @var string subject PM subject text
+ * @var object message_parser The message parser object
+ * @var bool submit Whether or not the form has been sumitted
+ * @var bool preview Whether or not the signature is being previewed
+ * @var array error Any error strings
+ * @since 3.1.10-RC1
+ */
+ $vars = array(
+ 'enable_bbcode',
+ 'enable_smilies',
+ 'enable_urls',
+ 'enable_sig',
+ 'subject',
+ 'message_parser',
+ 'submit',
+ 'preview',
+ 'error',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_modify_parse_before', compact($vars)));
+
// Parse Attachments - before checksum is calculated
$message_parser->parse_attachments('fileupload', $action, 0, $submit, $preview, $refresh, true);
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index c65bb83eae..a9f8e10eef 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -470,6 +470,8 @@ class ucp_profile
include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ $preview = $request->is_set_post('preview');
+
$enable_bbcode = ($config['allow_sig_bbcode']) ? $user->optionget('sig_bbcode') : false;
$enable_smilies = ($config['allow_sig_smilies']) ? $user->optionget('sig_smilies') : false;
$enable_urls = ($config['allow_sig_links']) ? $user->optionget('sig_links') : false;
@@ -478,7 +480,7 @@ class ucp_profile
$signature = $request->variable('signature', $decoded_message['text'], true);
$signature_preview = '';
- if ($submit || $request->is_set_post('preview'))
+ if ($submit || $preview)
{
$enable_bbcode = ($config['allow_sig_bbcode']) ? !$request->variable('disable_bbcode', false) : false;
$enable_smilies = ($config['allow_sig_smilies']) ? !$request->variable('disable_smilies', false) : false;
@@ -490,6 +492,31 @@ class ucp_profile
}
}
+ /**
+ * Modify user signature on editing profile in UCP
+ *
+ * @event core.ucp_profile_modify_signature
+ * @var bool enable_bbcode Whether or not bbcode is enabled
+ * @var bool enable_smilies Whether or not smilies are enabled
+ * @var bool enable_urls Whether or not urls are enabled
+ * @var string signature Users signature text
+ * @var array error Any error strings
+ * @var bool submit Whether or not the form has been sumitted
+ * @var bool preview Whether or not the signature is being previewed
+ * @since 3.1.10-RC1
+ * @change 3.2.0-RC2 Removed message parser
+ */
+ $vars = array(
+ 'enable_bbcode',
+ 'enable_smilies',
+ 'enable_urls',
+ 'signature',
+ 'error',
+ 'submit',
+ 'preview',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.ucp_profile_modify_signature', compact($vars)));
+
$bbcode_uid = $bbcode_bitfield = $bbcode_flags = '';
$warn_msg = generate_text_for_storage(
$signature,
@@ -531,6 +558,16 @@ class ucp_profile
'user_sig_bbcode_bitfield' => $bbcode_bitfield
);
+ /**
+ * Modify user registration data before submitting it to the database
+ *
+ * @event core.ucp_profile_modify_signature_sql_ary
+ * @var array sql_ary Array with user signature data to submit to the database
+ * @since 3.1.10-RC1
+ */
+ $vars = array('sql_ary');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_profile_modify_signature_sql_ary', compact($vars)));
+
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . $user->data['user_id'];