aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acp/acp_attachments.php2
-rw-r--r--phpBB/includes/acp/acp_forums.php9
-rw-r--r--phpBB/includes/acp/acp_users.php16
-rw-r--r--phpBB/includes/functions.php6
-rw-r--r--phpBB/includes/functions_admin.php9
-rw-r--r--phpBB/includes/functions_container.php4
-rw-r--r--phpBB/includes/functions_content.php18
-rw-r--r--phpBB/includes/functions_database_helper.php8
-rw-r--r--phpBB/includes/functions_download.php8
-rw-r--r--phpBB/includes/functions_install.php13
-rw-r--r--phpBB/includes/functions_module.php16
-rw-r--r--phpBB/includes/functions_posting.php14
-rw-r--r--phpBB/includes/functions_privmsgs.php14
-rw-r--r--phpBB/includes/functions_upload.php2
-rw-r--r--phpBB/includes/mcp/mcp_main.php17
-rw-r--r--phpBB/includes/mcp/mcp_queue.php16
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php4
-rw-r--r--phpBB/includes/ucp/ucp_profile.php7
18 files changed, 140 insertions, 43 deletions
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php
index 958a6456c2..f68fd76587 100644
--- a/phpBB/includes/acp/acp_attachments.php
+++ b/phpBB/includes/acp/acp_attachments.php
@@ -20,7 +20,7 @@ if (!defined('IN_PHPBB'))
*/
class acp_attachments
{
- /** @var \phpbb\db\driver\driver */
+ /** @var \phpbb\db\driver\driver_interface */
protected $db;
/** @var \phpbb\config\config */
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php
index a1af8c489d..c47d9bc185 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -138,12 +138,15 @@ class acp_forums
'enable_prune' => request_var('enable_prune', false),
'enable_post_review' => request_var('enable_post_review', true),
'enable_quick_reply' => request_var('enable_quick_reply', false),
+ 'enable_shadow_prune' => request_var('enable_shadow_prune', false),
'prune_days' => request_var('prune_days', 7),
'prune_viewed' => request_var('prune_viewed', 7),
'prune_freq' => request_var('prune_freq', 1),
'prune_old_polls' => request_var('prune_old_polls', false),
'prune_announce' => request_var('prune_announce', false),
'prune_sticky' => request_var('prune_sticky', false),
+ 'prune_shadow_days' => request_var('prune_shadow_days', 7),
+ 'prune_shadow_freq' => request_var('prune_shadow_freq', 1),
'forum_password' => request_var('forum_password', '', true),
'forum_password_confirm'=> request_var('forum_password_confirm', '', true),
'forum_password_unset' => request_var('forum_password_unset', false),
@@ -457,6 +460,9 @@ class acp_forums
'prune_days' => 7,
'prune_viewed' => 7,
'prune_freq' => 1,
+ 'enable_shadow_prune' => false,
+ 'prune_shadow_days' => 7,
+ 'prune_shadow_freq' => 1,
'forum_flags' => FORUM_FLAG_POST_REVIEW + FORUM_FLAG_ACTIVE_TOPICS,
'forum_options' => 0,
'forum_password' => '',
@@ -636,6 +642,8 @@ class acp_forums
'PRUNE_FREQ' => $forum_data['prune_freq'],
'PRUNE_DAYS' => $forum_data['prune_days'],
'PRUNE_VIEWED' => $forum_data['prune_viewed'],
+ 'PRUNE_SHADOW_FREQ' => $forum_data['prune_shadow_freq'],
+ 'PRUNE_SHADOW_DAYS' => $forum_data['prune_shadow_days'],
'TOPICS_PER_PAGE' => $forum_data['forum_topics_per_page'],
'FORUM_RULES_LINK' => $forum_data['forum_rules_link'],
'FORUM_RULES' => $forum_data['forum_rules'],
@@ -668,6 +676,7 @@ class acp_forums
'S_DISPLAY_SUBFORUM_LIST' => ($forum_data['display_subforum_list']) ? true : false,
'S_DISPLAY_ON_INDEX' => ($forum_data['display_on_index']) ? true : false,
'S_PRUNE_ENABLE' => ($forum_data['enable_prune']) ? true : false,
+ 'S_PRUNE_SHADOW_ENABLE' => ($forum_data['enable_shadow_prune']) ? true : false,
'S_FORUM_LINK_TRACK' => ($forum_data['forum_flags'] & FORUM_FLAG_LINK_TRACK) ? true : false,
'S_PRUNE_OLD_POLLS' => ($forum_data['forum_flags'] & FORUM_FLAG_PRUNE_POLL) ? true : false,
'S_PRUNE_ANNOUNCE' => ($forum_data['forum_flags'] & FORUM_FLAG_PRUNE_ANNOUNCE) ? true : false,
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 59b6f49436..a720334ed2 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -1253,17 +1253,13 @@ class acp_users
WHERE user_id = $user_id";
$db->sql_query($sql);
- switch ($log_warnings)
+ if ($log_warnings)
{
- case 2:
- add_log('admin', 'LOG_WARNINGS_DELETED', $user_row['username'], $num_warnings);
- break;
- case 1:
- add_log('admin', 'LOG_WARNING_DELETED', $user_row['username']);
- break;
- default:
- add_log('admin', 'LOG_WARNINGS_DELETED_ALL', $user_row['username']);
- break;
+ add_log('admin', 'LOG_WARNINGS_DELETED', $user_row['username'], $num_warnings);
+ }
+ else
+ {
+ add_log('admin', 'LOG_WARNINGS_DELETED_ALL', $user_row['username']);
}
}
}
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index ef17076def..0cb88cd8ee 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -2437,19 +2437,19 @@ function meta_refresh($time, $url, $disable_cd_check = false)
{
global $template, $refresh_data, $request;
+ $url = redirect($url, true, $disable_cd_check);
if ($request->is_ajax())
{
$refresh_data = array(
'time' => $time,
- 'url' => str_replace('&', '&', $url)
+ 'url' => $url,
);
}
else
{
- $url = redirect($url, true, $disable_cd_check);
+ // For XHTML compatibility we change back & to &
$url = str_replace('&', '&', $url);
- // For XHTML compatibility we change back & to &
$template->assign_vars(array(
'META' => '<meta http-equiv="refresh" content="' . $time . '; url=' . $url . '" />')
);
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index 81a381b326..d72f89b6ac 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -2326,6 +2326,11 @@ function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync
$sql_and .= " AND topic_last_view_time < $prune_date";
}
+ if ($prune_mode == 'shadow')
+ {
+ $sql_and .= ' AND topic_status = ' . ITEM_MOVED . " AND topic_last_post_time < $prune_date";
+ }
+
$sql = 'SELECT topic_id
FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_id) . "
@@ -2399,7 +2404,7 @@ function auto_prune($forum_id, $prune_mode, $prune_flags, $prune_days, $prune_fr
* via admin_permissions. Changes of usernames and group names
* must be carried through for the moderators table.
*
-* @param \phpbb\db\driver\driver $db Database connection
+* @param \phpbb\db\driver\driver_interface $db Database connection
* @param \phpbb\cache\driver\driver_interface Cache driver
* @param \phpbb\auth\auth $auth Authentication object
* @return null
@@ -2622,7 +2627,7 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
/**
* Removes moderators and administrators from foe lists.
*
-* @param \phpbb\db\driver\driver $db Database connection
+* @param \phpbb\db\driver\driver_interface $db Database connection
* @param \phpbb\auth\auth $auth Authentication object
* @param array|bool $group_id If an array, remove all members of this group from foe lists, or false to ignore
* @param array|bool $user_id If an array, remove this user from foe lists, or false to ignore
diff --git a/phpBB/includes/functions_container.php b/phpBB/includes/functions_container.php
index 667d27fd20..4a01c934bf 100644
--- a/phpBB/includes/functions_container.php
+++ b/phpBB/includes/functions_container.php
@@ -26,7 +26,7 @@ if (!defined('IN_PHPBB'))
* Used to bootstrap the container.
*
* @param string $config_file
-* @return \phpbb\db\driver\driver
+* @return \phpbb\db\driver\driver_interface
*/
function phpbb_bootstrap_db_connection($config_file)
{
@@ -239,7 +239,7 @@ function phpbb_create_dumped_container($config_file, array $extensions, array $p
*/
function phpbb_create_dumped_container_unless_debug($config_file, array $extensions, array $passes, $phpbb_root_path, $php_ext)
{
- $container_factory = defined('DEBUG') ? 'phpbb_create_compiled_container' : 'phpbb_create_dumped_container';
+ $container_factory = defined('DEBUG_CONTAINER') ? 'phpbb_create_compiled_container' : 'phpbb_create_dumped_container';
return $container_factory($config_file, $extensions, $passes, $phpbb_root_path, $php_ext);
}
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php
index dd9201165b..b1f69c5756 100644
--- a/phpBB/includes/functions_content.php
+++ b/phpBB/includes/functions_content.php
@@ -20,6 +20,7 @@ if (!defined('IN_PHPBB'))
* make_jumpbox()
* bump_topic_allowed()
* get_context()
+* phpbb_clean_search_string()
* decode_message()
* strip_bbcode()
* generate_text_for_display()
@@ -360,6 +361,23 @@ function get_context($text, $words, $length = 400)
}
/**
+* Cleans a search string by removing single wildcards from it and replacing multiple spaces with a single one.
+*
+* @param string $search_string The full search string which should be cleaned.
+*
+* @return string The cleaned search string without any wildcards and multiple spaces.
+*/
+function phpbb_clean_search_string($search_string)
+{
+ // This regular expressions matches every single wildcard.
+ // That means one after a whitespace or the beginning of the string or one before a whitespace or the end of the string.
+ $search_string = preg_replace('#(?<=^|\s)\*+(?=\s|$)#', '', $search_string);
+ $search_string = trim($search_string);
+ $search_string = preg_replace(array('#\s+#u', '#\*+#u'), array(' ', '*'), $search_string);
+ return $search_string;
+}
+
+/**
* Decode text whereby text is coming from the db and expected to be pre-parsed content
* We are placing this outside of the message parser because we are often in need of it...
*/
diff --git a/phpBB/includes/functions_database_helper.php b/phpBB/includes/functions_database_helper.php
index 923e542690..4b2cbdd25b 100644
--- a/phpBB/includes/functions_database_helper.php
+++ b/phpBB/includes/functions_database_helper.php
@@ -22,14 +22,14 @@ if (!defined('IN_PHPBB'))
*
* The only supported table is bookmarks.
*
-* @param \phpbb\db\driver\driver $db Database object
+* @param \phpbb\db\driver\driver_interface $db Database object
* @param string $table Table on which to perform the update
* @param string $column Column whose values to change
* @param array $from_values An array of values that should be changed
* @param int $to_value The new value
* @return null
*/
-function phpbb_update_rows_avoiding_duplicates(\phpbb\db\driver\driver $db, $table, $column, $from_values, $to_value)
+function phpbb_update_rows_avoiding_duplicates(\phpbb\db\driver\driver_interface $db, $table, $column, $from_values, $to_value)
{
$sql = "SELECT $column, user_id
FROM $table
@@ -107,14 +107,14 @@ function phpbb_update_rows_avoiding_duplicates(\phpbb\db\driver\driver $db, $tab
*
* The only supported table is topics_watch.
*
-* @param \phpbb\db\driver\driver $db Database object
+* @param \phpbb\db\driver\driver_interface $db Database object
* @param string $table Table on which to perform the update
* @param string $column Column whose values to change
* @param array $from_values An array of values that should be changed
* @param int $to_value The new value
* @return null
*/
-function phpbb_update_rows_avoiding_duplicates_notify_status(\phpbb\db\driver\driver $db, $table, $column, $from_values, $to_value)
+function phpbb_update_rows_avoiding_duplicates_notify_status(\phpbb\db\driver\driver_interface $db, $table, $column, $from_values, $to_value)
{
$sql = "SELECT $column, user_id, notify_status
FROM $table
diff --git a/phpBB/includes/functions_download.php b/phpBB/includes/functions_download.php
index c895f7b54b..7ad34d9515 100644
--- a/phpBB/includes/functions_download.php
+++ b/phpBB/includes/functions_download.php
@@ -596,7 +596,7 @@ function phpbb_parse_range_request($request_array, $filesize)
/**
* Increments the download count of all provided attachments
*
-* @param \phpbb\db\driver\driver $db The database object
+* @param \phpbb\db\driver\driver_interface $db The database object
* @param array|int $ids The attach_id of each attachment
*
* @return null
@@ -617,7 +617,7 @@ function phpbb_increment_downloads($db, $ids)
/**
* Handles authentication when downloading attachments from a post or topic
*
-* @param \phpbb\db\driver\driver $db The database object
+* @param \phpbb\db\driver\driver_interface $db The database object
* @param \phpbb\auth\auth $auth The authentication object
* @param int $topic_id The id of the topic that we are downloading from
*
@@ -663,7 +663,7 @@ function phpbb_download_handle_forum_auth($db, $auth, $topic_id)
/**
* Handles authentication when downloading attachments from PMs
*
-* @param \phpbb\db\driver\driver $db The database object
+* @param \phpbb\db\driver\driver_interface $db The database object
* @param \phpbb\auth\auth $auth The authentication object
* @param int $user_id The user id
* @param int $msg_id The id of the PM that we are downloading from
@@ -690,7 +690,7 @@ function phpbb_download_handle_pm_auth($db, $auth, $user_id, $msg_id)
/**
* Checks whether a user can download from a particular PM
*
-* @param \phpbb\db\driver\driver $db The database object
+* @param \phpbb\db\driver\driver_interface $db The database object
* @param int $user_id The user id
* @param int $msg_id The id of the PM that we are downloading from
*
diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php
index 476535ae5b..4f8ec99d88 100644
--- a/phpBB/includes/functions_install.php
+++ b/phpBB/includes/functions_install.php
@@ -486,12 +486,14 @@ function adjust_language_keys_callback($matches)
* @param array $data Array containing the database connection information
* @param string $dbms The name of the DBAL class to use
* @param bool $debug If the debug constants should be enabled by default or not
+* @param bool $debug_container If the container should be compiled on
+* every page load or not
* @param bool $debug_test If the DEBUG_TEST constant should be added
* NOTE: Only for use within the testing framework
*
* @return string The output to write to the file
*/
-function phpbb_create_config_file_data($data, $dbms, $debug = false, $debug_test = false)
+function phpbb_create_config_file_data($data, $dbms, $debug = false, $debug_container = false, $debug_test = false)
{
$config_data = "<?php\n";
$config_data .= "// phpBB 3.1.x auto-generated configuration file\n// Do not change anything in this file!\n";
@@ -526,6 +528,15 @@ function phpbb_create_config_file_data($data, $dbms, $debug = false, $debug_test
$config_data .= "// @define('DEBUG', true);\n";
}
+ if ($debug_container)
+ {
+ $config_data .= "@define('DEBUG_CONTAINER', true);\n";
+ }
+ else
+ {
+ $config_data .= "// @define('DEBUG_CONTAINER', true);\n";
+ }
+
if ($debug_test)
{
$config_data .= "@define('DEBUG_TEST', true);\n";
diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php
index ef2e009a6e..be066de0f0 100644
--- a/phpBB/includes/functions_module.php
+++ b/phpBB/includes/functions_module.php
@@ -80,7 +80,7 @@ class p_master
function list_modules($p_class)
{
global $auth, $db, $user, $cache;
- global $config, $phpbb_root_path, $phpEx;
+ global $config, $phpbb_root_path, $phpEx, $phpbb_dispatcher;
// Sanitise for future path use, it's escaped as appropriate for queries
$this->p_class = str_replace(array('.', '/', '\\'), '', basename($p_class));
@@ -284,6 +284,20 @@ class p_master
$custom_func($row['module_mode'], $module_row);
}
+ /**
+ * This event allows to modify parameters for building modules list
+ *
+ * @event core.modify_module_row
+ * @var string url_func Function for building 'url_extra'
+ * @var string lang_func Function for building the language name
+ * @var string custom_func Custom function for calling parameters on module init
+ * @var array row Array holding the basic module data
+ * @var array module_row Array holding the module display parameters
+ * @since 3.1.0-b3
+ */
+ $vars = array('url_func', 'lang_func', 'custom_func', 'row', 'module_row');
+ extract($phpbb_dispatcher->trigger_event('core.modify_module_row', compact($vars)));
+
$this->module_ary[] = $module_row;
}
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 6a0aedf8c6..51bbcb8bae 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -1153,7 +1153,7 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false,
'S_FRIEND' => ($row['friend']) ? true : false,
'S_IGNORE_POST' => ($row['foe']) ? true : false,
- 'L_IGNORE_POST' => ($row['foe']) ? sprintf($user->lang['POST_BY_FOE'], get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), "<a href=\"{$u_show_post}\" onclick=\"dE('{$post_anchor}', 1); return false;\">", '</a>') : '',
+ 'L_IGNORE_POST' => ($row['foe']) ? sprintf($user->lang['POST_BY_FOE'], get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), "<a href=\"{$u_show_post}\" onclick=\"phpbb.toggleDisplay('{$post_anchor}', 1); return false;\">", '</a>') : '',
'POST_SUBJECT' => $post_subject,
'MINI_POST_IMG' => $user->img('icon_post_target', $user->lang['POST']),
@@ -2272,8 +2272,10 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
case 'edit_first_post':
case 'edit':
case 'edit_last_post':
- // @todo: Check whether these notification deletions are correct
- $phpbb_notifications->delete_notifications('topic', $data['topic_id']);
+ if ($data['topic_visibility'] != ITEM_APPROVED)
+ {
+ $phpbb_notifications->delete_notifications('topic', $data['topic_id']);
+ }
$phpbb_notifications->delete_notifications(array(
'quote',
@@ -2297,8 +2299,10 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
case 'edit_first_post':
case 'edit':
case 'edit_last_post':
- // @todo: Check whether these notification deletions are correct
- $phpbb_notifications->delete_notifications('topic', $data['topic_id']);
+ if ($data['topic_visibility'] != ITEM_APPROVED)
+ {
+ $phpbb_notifications->delete_notifications('topic', $data['topic_id']);
+ }
$phpbb_notifications->delete_notifications(array(
'quote',
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index 17d67b4a23..9b44984dfa 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -1575,7 +1575,7 @@ function get_folder_status($folder_id, $folder)
*/
function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
{
- global $db, $auth, $config, $phpEx, $template, $user, $phpbb_root_path, $phpbb_container;
+ global $db, $auth, $config, $phpEx, $template, $user, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher;
// We do not handle erasing pms here
if ($mode == 'delete')
@@ -1585,6 +1585,18 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
$current_time = time();
+ /**
+ * Get all parts of the PM that are to be submited to the DB.
+ *
+ * @event core.submit_pm_before
+ * @var string mode PM Post mode - post|reply|quote|quotepost|forward|edit
+ * @var string subject Subject of the private message
+ * @var array data The whole row data of the PM.
+ * @since 3.1.0-b3
+ */
+ $vars = array('mode', 'subject', 'data');
+ extract($phpbb_dispatcher->trigger_event('core.submit_pm_before', compact($vars)));
+
// Collect some basic information about which tables and which rows to update/insert
$sql_data = array();
$root_level = 0;
diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php
index 04d483e14c..9d61e39c98 100644
--- a/phpBB/includes/functions_upload.php
+++ b/phpBB/includes/functions_upload.php
@@ -64,7 +64,7 @@ class filespec
$this->filename = $upload_ary['tmp_name'];
$this->filesize = $upload_ary['size'];
$name = (STRIP) ? stripslashes($upload_ary['name']) : $upload_ary['name'];
- $name = trim(utf8_htmlspecialchars(utf8_basename($name)));
+ $name = trim(utf8_basename($name));
$this->realname = $this->uploadname = $name;
$this->mimetype = $upload_ary['type'];
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php
index 016094c5d4..55440bf192 100644
--- a/phpBB/includes/mcp/mcp_main.php
+++ b/phpBB/includes/mcp/mcp_main.php
@@ -415,9 +415,8 @@ function change_topic_type($action, $topic_ids)
*/
function mcp_move_topic($topic_ids)
{
- global $auth, $user, $db, $template;
+ global $auth, $user, $db, $template, $phpbb_log, $request;
global $phpEx, $phpbb_root_path;
- global $request;
// Here we limit the operation to one forum only
$forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_move'), true);
@@ -525,9 +524,19 @@ function mcp_move_topic($topic_ids)
$forum_ids = array($to_forum_id);
foreach ($topic_data as $topic_id => $row)
{
- // Get the list of forums to resync, add a log entry
+ // Get the list of forums to resync
$forum_ids[] = $row['forum_id'];
- add_log('mod', $to_forum_id, $topic_id, 'LOG_MOVE', $row['forum_name'], $forum_data['forum_name']);
+
+ // We add the $to_forum_id twice, because 'forum_id' is updated
+ // when the topic is moved again later.
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_MOVE', false, array(
+ 'forum_id' => (int) $to_forum_id,
+ 'topic_id' => (int) $topic_id,
+ $row['forum_name'],
+ $forum_data['forum_name'],
+ (int) $row['forum_id'],
+ (int) $forum_data['forum_id'],
+ ));
// Leave a redirection if required and only if the topic is visible to users
if ($leave_shadow && $row['topic_visibility'] == ITEM_APPROVED && $row['topic_type'] != POST_GLOBAL)
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index a46c4bd499..8d998919e5 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -1163,6 +1163,22 @@ class mcp_queue
$success_msg .= '_DELETED_SUCCESS';
}
+ // If we came from viewtopic, we try to go back to it.
+ if (strpos($redirect, $phpbb_root_path . 'viewtopic.' . $phpEx) === 0)
+ {
+ if ($num_disapproved_topics == 0)
+ {
+ // So we need to remove the post id part from the Url
+ $redirect = str_replace("&amp;p={$post_id_list[0]}#p{$post_id_list[0]}", '', $redirect);
+ }
+ else
+ {
+ // However this is only possible if the topic still exists,
+ // Otherwise we go back to the viewforum page
+ $redirect = append_sid($phpbb_root_path . 'viewforum.' . $phpEx, 'f=' . $request->variable('f', 0));
+ }
+ }
+
meta_refresh(3, $redirect);
$message = $user->lang[$success_msg];
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index 87dfdf902b..3d95dc9a97 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -1081,6 +1081,7 @@ function compose_pm($id, $mode, $action, $user_folders = array())
'S_SAVE_ALLOWED' => ($auth->acl_get('u_savedrafts') && $action != 'edit') ? true : false,
'S_HAS_DRAFTS' => ($auth->acl_get('u_savedrafts') && $drafts),
'S_FORM_ENCTYPE' => $form_enctype,
+ 'S_ATTACH_DATA' => json_encode($message_parser->attachment_data),
'S_BBCODE_IMG' => $img_status,
'S_BBCODE_FLASH' => $flash_status,
@@ -1104,7 +1105,8 @@ function compose_pm($id, $mode, $action, $user_folders = array())
if ($allowed)
{
- $plupload->configure($cache, $template, $s_action, false);
+ $max_files = ($auth->acl_gets('a_', 'm_')) ? 0 : (int) $config['max_attachments_pm'];
+ $plupload->configure($cache, $template, $s_action, false, $max_files);
}
// Attachment entry
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index 76f8988fb9..00b53b6576 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -672,15 +672,14 @@ class ucp_profile
$sql = 'SELECT key_id, last_ip, last_login
FROM ' . SESSIONS_KEYS_TABLE . '
- WHERE user_id = ' . (int) $user->data['user_id'];
+ WHERE user_id = ' . (int) $user->data['user_id'] . '
+ ORDER BY last_login ASC';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$template->assign_block_vars('sessions', array(
- 'errors' => $error,
-
'KEY' => $row['key_id'],
'IP' => $row['last_ip'],
'LOGIN_TIME' => $user->format_date($row['last_login']),
@@ -693,6 +692,8 @@ class ucp_profile
}
$template->assign_vars(array(
+ 'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
+
'L_TITLE' => $user->lang['UCP_PROFILE_' . strtoupper($mode)],
'S_HIDDEN_FIELDS' => $s_hidden_fields,