1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-10 18:54:08 +02:00

- 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
This commit is contained in:
Meik Sievertsen
2006-12-21 10:37:50 +00:00
parent 2e1eef2713
commit 515085a2a2
11 changed files with 155 additions and 92 deletions

View File

@@ -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);
}
}
}