mirror of
https://github.com/phpbb/phpbb.git
synced 2025-03-13 20:28:44 +01:00
What use is a shiny banstick(TM) if nobody finds it?
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8574 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
a3368632d0
commit
bb8a48817c
@ -108,6 +108,7 @@
|
||||
<li>[Feature] Added optional stricter upload validation to avoid mime sniffing in addition to the safeguards provided by file.php. (thanks to Nicolas Grekas for compiling the list).</li>
|
||||
<li>[Fix] Do not remove whitespace in front of url containing the boards url and no relative path appended (Bug #27355)</li>
|
||||
<li>[Change] Show email ban reason on registration. Additionally allow custom errors properly returned if using validate_data(). (Bug #26885)</li>
|
||||
<li>[Feature] Streamlined banning via the MCP by adding a ban link to the user profile. Also pre-fills ban fields as far as possible.</li>
|
||||
</ul>
|
||||
|
||||
<a name="v300"></a><h3>1.ii. Changes since 3.0.0</h3>
|
||||
|
@ -151,7 +151,7 @@ class mcp_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;
|
||||
}
|
||||
@ -163,11 +163,24 @@ class mcp_ban
|
||||
|
||||
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);
|
||||
$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)
|
||||
@ -176,13 +189,29 @@ class mcp_ban
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -132,6 +132,7 @@ $lang = array_merge($lang, array(
|
||||
|
||||
'USERNAME_BEGINS_WITH' => 'Username begins with',
|
||||
'USER_ADMIN' => 'Administrate user',
|
||||
'USER_BAN' => 'Banning',
|
||||
'USER_FORUM' => 'User statistics',
|
||||
'USER_ONLINE' => 'Online',
|
||||
'USER_PRESENCE' => 'Board presence',
|
||||
|
@ -551,6 +551,8 @@ switch ($mode)
|
||||
'S_CUSTOM_FIELDS' => (isset($profile_fields['row']) && sizeof($profile_fields['row'])) ? true : false,
|
||||
|
||||
'U_USER_ADMIN' => ($auth->acl_get('a_user')) ? append_sid("{$phpbb_root_path}adm/index.$phpEx", 'i=users&mode=overview&u=' . $user_id, true, $user->session_id) : '',
|
||||
'U_USER_BAN' => ($auth->acl_get('m_ban')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=ban&mode=user&u=' . $user_id) : '',
|
||||
|
||||
'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_id) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&u={$user_id}") : '',
|
||||
|
||||
'S_ZEBRA' => ($user->data['user_id'] != $user_id && $user->data['is_registered'] && $zebra_enabled) ? true : false,
|
||||
|
@ -44,7 +44,7 @@
|
||||
<fieldset>
|
||||
<dl>
|
||||
<dt><label for="ban">{L_BAN_CELL}:</label></dt>
|
||||
<dd><label for="ban"><textarea name="ban" id="ban" class="inputbox" cols="40" rows="3">{USERNAMES}</textarea></label></dd>
|
||||
<dd><label for="ban"><textarea name="ban" id="ban" class="inputbox" cols="40" rows="3">{BAN_QUANTIFIER}</textarea></label></dd>
|
||||
<!-- IF S_USERNAME_BAN --><dd><strong><a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a></strong></dd><!-- ENDIF -->
|
||||
</dl>
|
||||
<dl>
|
||||
|
@ -19,6 +19,7 @@
|
||||
<dd>
|
||||
<!-- IF USER_COLOR --><span style="color: {USER_COLOR}; font-weight: bold;"><!-- ELSE --><span><!-- ENDIF -->{USERNAME}</span>
|
||||
<!-- IF U_USER_ADMIN --> [ <a href="{U_USER_ADMIN}">{L_USER_ADMIN}</a> ]<!-- ENDIF -->
|
||||
<!-- IF U_USER_BAN --> [ <a href="{U_USER_BAN}">{L_USER_BAN}</a> ]<!-- ENDIF -->
|
||||
<!-- IF U_SWITCH_PERMISSIONS --> [ <a href="{U_SWITCH_PERMISSIONS}">{L_USE_PERMISSIONS}</a> ]<!-- ENDIF -->
|
||||
</dd>
|
||||
<!-- IF not AVATAR_IMG -->
|
||||
|
Loading…
x
Reference in New Issue
Block a user