aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/functions_privmsgs.php2
-rw-r--r--phpBB/includes/functions_user.php41
2 files changed, 33 insertions, 10 deletions
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index 29cea477e4..ad142b1cca 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -1573,7 +1573,7 @@ function get_folder_status($folder_id, $folder)
'cur' => $folder['num_messages'],
'remaining' => ($user->data['message_limit']) ? $user->data['message_limit'] - $folder['num_messages'] : 0,
'max' => $user->data['message_limit'],
- 'percent' => ($user->data['message_limit']) ? (($user->data['message_limit'] > 0) ? round(($folder['num_messages'] / $user->data['message_limit']) * 100) : 100) : 0,
+ 'percent' => ($user->data['message_limit']) ? (($user->data['message_limit'] > 0) ? floor(($folder['num_messages'] / $user->data['message_limit']) * 100) : 100) : 0,
);
$return['message'] = $user->lang('FOLDER_STATUS_MSG', $user->lang('MESSAGES_COUNT', (int) $return['max']), $return['cur'], $return['percent']);
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 38ae34c66c..e4479f07b0 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -363,12 +363,16 @@ function user_add($user_row, $cp_data = false)
}
/**
-* Remove User
-* @param $mode Either 'retain' or 'remove'
-*/
+ * Remove User
+ *
+ * @param string $mode Either 'retain' or 'remove'
+ * @param mixed $user_ids Either an array of integers or an integer
+ * @param bool $retain_username
+ * @return bool
+ */
function user_delete($mode, $user_ids, $retain_username = true)
{
- global $cache, $config, $db, $user, $auth, $phpbb_dispatcher;
+ global $cache, $config, $db, $user, $phpbb_dispatcher;
global $phpbb_root_path, $phpEx;
$db->sql_transaction('begin');
@@ -555,11 +559,6 @@ function user_delete($mode, $user_ids, $retain_username = true)
WHERE ' . $db->sql_in_set('poster_id', $user_ids);
$db->sql_query($sql);
- $sql = 'UPDATE ' . POSTS_TABLE . '
- SET post_edit_user = ' . ANONYMOUS . '
- WHERE ' . $db->sql_in_set('post_edit_user', $user_ids);
- $db->sql_query($sql);
-
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_posts = user_posts + ' . $added_guest_posts . '
WHERE user_id = ' . ANONYMOUS;
@@ -589,6 +588,30 @@ function user_delete($mode, $user_ids, $retain_username = true)
$cache->destroy('sql', MODERATOR_CACHE_TABLE);
+ // Change user_id to anonymous for posts edited by this user
+ $sql = 'UPDATE ' . POSTS_TABLE . '
+ SET post_edit_user = ' . ANONYMOUS . '
+ WHERE ' . $db->sql_in_set('post_edit_user', $user_ids);
+ $db->sql_query($sql);
+
+ // Change user_id to anonymous for pms edited by this user
+ $sql = 'UPDATE ' . PRIVMSGS_TABLE . '
+ SET message_edit_user = ' . ANONYMOUS . '
+ WHERE ' . $db->sql_in_set('message_edit_user', $user_ids);
+ $db->sql_query($sql);
+
+ // Change user_id to anonymous for posts deleted by this user
+ $sql = 'UPDATE ' . POSTS_TABLE . '
+ SET post_delete_user = ' . ANONYMOUS . '
+ WHERE ' . $db->sql_in_set('post_delete_user', $user_ids);
+ $db->sql_query($sql);
+
+ // Change user_id to anonymous for topics deleted by this user
+ $sql = 'UPDATE ' . TOPICS_TABLE . '
+ SET topic_delete_user = ' . ANONYMOUS . '
+ WHERE ' . $db->sql_in_set('topic_delete_user', $user_ids);
+ $db->sql_query($sql);
+
// Delete user log entries about this user
$sql = 'DELETE FROM ' . LOG_TABLE . '
WHERE ' . $db->sql_in_set('reportee_id', $user_ids);