diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 6ee8b91959..266ea2a80a 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -202,6 +202,7 @@
[Feature] Add unread posts quick search option (Bug #46765 - Patch by rxu)
[Feature] Add option to disable remote upload avatars (Bug #45375 - Patch by nickvergessen)
[Feature] Ability to delete warnings and keep warnings permanently (Bug #43375 - Patch by nickvergessen)
+ [Feature] Ability to empty a user's outbox from the user ACP quick tools.
1.ii. Changes since 3.0.4
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index c27c259b46..cb342ac300 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -495,6 +495,56 @@ class acp_users
break;
+ case 'deloutbox':
+
+ if (confirm_box(true))
+ {
+ $msg_ids = array();
+ $lang = 'EMPTY';
+
+ $sql = 'SELECT msg_id
+ FROM ' . PRIVMSGS_TO_TABLE . "
+ WHERE author_id = $user_id
+ AND folder_id = " . PRIVMSGS_OUTBOX;
+ $result = $db->sql_query($sql);
+
+ if ($row = $db->sql_fetchrow($result))
+ {
+ if (!function_exists('delete_pm'))
+ {
+ include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
+ }
+
+ do
+ {
+ $msg_ids[] = (int) $row['msg_id'];
+ }
+ while ($row = $db->sql_fetchrow($result));
+
+ $db->sql_freeresult($result);
+
+ delete_pm($user_id, $msg_ids, PRIVMSGS_OUTBOX);
+
+ add_log('admin', 'LOG_USER_DEL_OUTBOX', $user_row['username']);
+
+ $lang = 'EMPTIED';
+ }
+ $db->sql_freeresult($result);
+
+ trigger_error($user->lang['USER_OUTBOX_' . $lang] . adm_back_link($this->u_action . '&u=' . $user_id));
+ }
+ else
+ {
+ confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
+ 'u' => $user_id,
+ 'i' => $id,
+ 'mode' => $mode,
+ 'action' => $action,
+ 'update' => true))
+ );
+ }
+ break;
+
case 'moveposts':
if (!check_form_key($form_name))
@@ -842,7 +892,7 @@ class acp_users
if ($user_id == $user->data['user_id'])
{
- $quick_tool_ary = array('delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH');
+ $quick_tool_ary = array('delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH', 'deloutbox' => 'DEL_OUTBOX');
if ($user_row['user_new'])
{
$quick_tool_ary['leave_nr'] = 'LEAVE_NR';
@@ -862,12 +912,13 @@ class acp_users
$quick_tool_ary += array('active' => (($user_row['user_type'] == USER_INACTIVE) ? 'ACTIVATE' : 'DEACTIVATE'));
}
- $quick_tool_ary += array('delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH');
+ $quick_tool_ary += array('delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH', 'deloutbox' => 'DEL_OUTBOX');
if ($config['email_enable'] && ($user_row['user_type'] == USER_NORMAL || $user_row['user_type'] == USER_INACTIVE))
{
$quick_tool_ary['reactivate'] = 'FORCE';
}
+
if ($user_row['user_new'])
{
$quick_tool_ary['leave_nr'] = 'LEAVE_NR';
diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php
index 9f69fe3790..4a334a44d3 100644
--- a/phpBB/language/en/acp/common.php
+++ b/phpBB/language/en/acp/common.php
@@ -675,6 +675,7 @@ $lang = array_merge($lang, array(
'LOG_USER_DELETED' => 'Deleted user
» %s',
'LOG_USER_DEL_ATTACH' => 'Removed all attachments made by the user
» %s',
'LOG_USER_DEL_AVATAR' => 'Removed user avatar
» %s',
+ 'LOG_USER_DEL_OUTBOX' => 'Emptied user outbox
» %s',
'LOG_USER_DEL_POSTS' => 'Removed all posts made by the user
» %s',
'LOG_USER_DEL_SIG' => 'Removed user signature
» %s',
'LOG_USER_INACTIVE' => 'User deactivated
» %s',
diff --git a/phpBB/language/en/acp/users.php b/phpBB/language/en/acp/users.php
index a2d1b3911c..8d9bf0d486 100644
--- a/phpBB/language/en/acp/users.php
+++ b/phpBB/language/en/acp/users.php
@@ -103,6 +103,7 @@ $lang = array_merge($lang, array(
'USER_ADMIN_DEACTIVED' => 'User deactivated successfully.',
'USER_ADMIN_DEL_ATTACH' => 'Delete all attachments',
'USER_ADMIN_DEL_AVATAR' => 'Delete avatar',
+ 'USER_ADMIN_DEL_OUTBOX' => 'Empty PM outbox',
'USER_ADMIN_DEL_POSTS' => 'Delete all posts',
'USER_ADMIN_DEL_SIG' => 'Delete signature',
'USER_ADMIN_EXPLAIN' => 'Here you can change your users information and certain specific options.',
@@ -122,6 +123,8 @@ $lang = array_merge($lang, array(
'USER_GROUP_SPECIAL' => 'Pre-defined groups user is a member of',
'USER_LIFTED_NR' => 'Successfully removed the user’s newly registered status.',
'USER_NO_ATTACHMENTS' => 'There are no attached files to display.',
+ 'USER_OUTBOX_EMPTIED' => 'Successfully emptied user’s private message outbox.',
+ 'USER_OUTBOX_EMPTY' => 'The user’s private message outbox was already empty.',
'USER_OVERVIEW_UPDATED' => 'User details updated.',
'USER_POSTS_DELETED' => 'Successfully removed all posts made by this user.',
'USER_POSTS_MOVED' => 'Successfully moved users posts to target forum.',