Line 151 | Line 151 |
---|
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp_ban&field=ban'), ));
|
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp_ban&field=ban'), ));
|
if ($mode != 'user')
| if ($mode === 'email' && !$auth->acl_get('a_user'))
|
{ return; }
| { return; }
|
Line 159 | Line 159 |
---|
// 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);
|
// 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;
| $username = $pre_fill = false;
|
if ($user_id && $user_id <> ANONYMOUS) {
|
if ($user_id && $user_id <> ANONYMOUS) {
|
$sql = 'SELECT username
| $sql = 'SELECT username, user_email, user_ip
|
FROM ' . USERS_TABLE . ' WHERE user_id = ' . $user_id; $result = $db->sql_query($sql);
|
FROM ' . USERS_TABLE . ' WHERE user_id = ' . $user_id; $result = $db->sql_query($sql);
|
$username = (string) $db->sql_fetchfield('username');
| switch ($mode) { case 'user': $pre_fill = (string) $db->sql_fetchfield('username'); break; case 'ip': $pre_fill = (string) $db->sql_fetchfield('user_ip'); break;
case 'email': $pre_fill = (string) $db->sql_fetchfield('user_email'); break; }
|
$db->sql_freeresult($result); } else if ($post_id)
| $db->sql_freeresult($result); } else if ($post_id)
|
Line 176 | Line 189 |
---|
if (sizeof($post_info) && !empty($post_info[$post_id])) {
|
if (sizeof($post_info) && !empty($post_info[$post_id])) {
|
$username = $post_info[$post_id]['username'];
| switch ($mode) { case 'user': $pre_fill = $post_info[$post_id]['username']; break;
case 'ip': $pre_fill = $post_info[$post_id]['poster_ip']; break;
case 'email': $pre_fill = $post_info[$post_id]['user_email']; break; }
|
} }
|
} }
|
if ($username)
| if ($pre_fill)
|
{
|
{
|
$template->assign_var('USERNAMES', $username);
| // left for legacy template compatibility $template->assign_var('USERNAMES', $pre_fill); $template->assign_var('BAN_QUANTIFIER', $pre_fill);
|
} } }
| } } }
|