diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-12-21 10:37:50 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-12-21 10:37:50 +0000 |
commit | 515085a2a2d4b06989566a60b8add3fa4864f1e3 (patch) | |
tree | 9000d688dc33511560a9d08191b87d1340f70af3 /phpBB/includes/mcp/mcp_ban.php | |
parent | 2e1eef2713f7891ce9d78736ceae6d2faf93fc4b (diff) | |
download | forums-515085a2a2d4b06989566a60b8add3fa4864f1e3.tar forums-515085a2a2d4b06989566a60b8add3fa4864f1e3.tar.gz forums-515085a2a2d4b06989566a60b8add3fa4864f1e3.tar.bz2 forums-515085a2a2d4b06989566a60b8add3fa4864f1e3.tar.xz forums-515085a2a2d4b06989566a60b8add3fa4864f1e3.zip |
- some fixes
- important bugfix for the mcp and determining allowed ids in general (if global announcements are included)
git-svn-id: file:///svn/phpbb/trunk@6787 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/mcp/mcp_ban.php')
-rw-r--r-- | phpBB/includes/mcp/mcp_ban.php | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/phpBB/includes/mcp/mcp_ban.php b/phpBB/includes/mcp/mcp_ban.php index 510943aa45..5a7240143a 100644 --- a/phpBB/includes/mcp/mcp_ban.php +++ b/phpBB/includes/mcp/mcp_ban.php @@ -104,8 +104,41 @@ class mcp_ban 'U_ACTION' => $this->u_action, 'U_FIND_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp_ban&field=ban'), - ) - ); + )); + + if ($mode != 'user') + { + return; + } + + // As a "service" we will check if any post id is specified and populate the username of the poster id if given + $post_id = request_var('p', 0); + $user_id = request_var('u', 0); + $username = false; + + if ($user_id && $user_id <> ANONYMOUS) + { + $sql = 'SELECT username + FROM ' . USERS_TABLE . ' + WHERE user_id = ' . $user_id; + $result = $db->sql_query($sql); + $username = (string) $db->sql_fetchfield('username'); + $db->sql_freeresult($result); + } + else if ($post_id) + { + $post_info = get_post_data($post_id, 'm_ban'); + + if (sizeof($post_info) && !empty($post_info[$post_id])) + { + $username = $post_info[$post_id]['username']; + } + } + + if ($username) + { + $template->assign_var('USERNAMES', $username); + } } } |