diff options
author | Marc Alexander <admin@m-a-styles.de> | 2014-09-23 11:08:56 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2014-09-23 11:08:56 +0200 |
commit | 8bd1853b56b78ecbf6b06dea623284514589d339 (patch) | |
tree | 645031904221b07ac76f11d3f2c159018a84c89c /phpBB/includes/functions_user.php | |
parent | f01b602e9f735fc6f807aa542371a6c9a24b33d3 (diff) | |
parent | bea5f94de654df6b009d6058816ad500836469b3 (diff) | |
download | forums-8bd1853b56b78ecbf6b06dea623284514589d339.tar forums-8bd1853b56b78ecbf6b06dea623284514589d339.tar.gz forums-8bd1853b56b78ecbf6b06dea623284514589d339.tar.bz2 forums-8bd1853b56b78ecbf6b06dea623284514589d339.tar.xz forums-8bd1853b56b78ecbf6b06dea623284514589d339.zip |
Merge pull request #2981 from nickvergessen/ticket/10729
Ticket/10729 Update editor information when user being deleted
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 ea8b0a4640..abb057df5b 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -329,11 +329,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 * @@ -439,11 +444,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"; @@ -501,6 +501,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; |