diff options
author | Thomas Backlund <tmb@mageia.org> | 2017-05-26 20:02:07 +0300 |
---|---|---|
committer | Thomas Backlund <tmb@mageia.org> | 2017-05-26 20:02:07 +0300 |
commit | 5e6803684739dc0963d784c0cefd86697ad397f3 (patch) | |
tree | 8ab6acff6c8069c5ba3035cba3adec90dba24ba1 /phpBB/includes/functions_user.php | |
parent | 8fc97191a3533a1cce0b051baa55db68d83b5dc4 (diff) | |
parent | 11242dd07d6359a725f22f3674028adfdddb49d6 (diff) | |
download | forums-5e6803684739dc0963d784c0cefd86697ad397f3.tar forums-5e6803684739dc0963d784c0cefd86697ad397f3.tar.gz forums-5e6803684739dc0963d784c0cefd86697ad397f3.tar.bz2 forums-5e6803684739dc0963d784c0cefd86697ad397f3.tar.xz forums-5e6803684739dc0963d784c0cefd86697ad397f3.zip |
Merge tag 'release-3.0.14' of https://github.com/phpbb/phpbb
Merge upstream 3.0.14 release.
Diffstat (limited to 'phpBB/includes/functions_user.php')
-rw-r--r-- | phpBB/includes/functions_user.php | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index cd8339d58a..40b06836a4 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -332,11 +332,16 @@ function user_add($user_row, $cp_data = false) } /** -* Remove User -*/ + * Remove User + * + * @param string $mode 'retain' or 'remove' + * @param int $user_id + * @param mixed $post_username + * @return bool + */ function user_delete($mode, $user_id, $post_username = false) { - global $cache, $config, $db, $user, $auth; + global $cache, $config, $db, $user; global $phpbb_root_path, $phpEx; $sql = 'SELECT * @@ -442,11 +447,6 @@ function user_delete($mode, $user_id, $post_username = false) WHERE poster_id = $user_id"; $db->sql_query($sql); - $sql = 'UPDATE ' . POSTS_TABLE . ' - SET post_edit_user = ' . ANONYMOUS . " - WHERE post_edit_user = $user_id"; - $db->sql_query($sql); - $sql = 'UPDATE ' . TOPICS_TABLE . ' SET topic_poster = ' . ANONYMOUS . ", topic_first_poster_name = '" . $db->sql_escape($post_username) . "', topic_first_poster_colour = '' WHERE topic_poster = $user_id"; @@ -504,6 +504,18 @@ function user_delete($mode, $user_id, $post_username = false) $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 post_edit_user = ' . $user_id; + $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 message_edit_user = ' . $user_id; + $db->sql_query($sql); + // Delete user log entries about this user $sql = 'DELETE FROM ' . LOG_TABLE . ' WHERE reportee_id = ' . $user_id; |