aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/docs/CHANGELOG.html1
-rw-r--r--phpBB/includes/mcp/mcp_ban.php41
-rw-r--r--phpBB/language/en/memberlist.php1
-rw-r--r--phpBB/memberlist.php2
-rw-r--r--phpBB/styles/prosilver/template/mcp_ban.html2
-rw-r--r--phpBB/styles/prosilver/template/memberlist_view.html1
6 files changed, 41 insertions, 7 deletions
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index f145431a5d..de46bb1232 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -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>
diff --git a/phpBB/includes/mcp/mcp_ban.php b/phpBB/includes/mcp/mcp_ban.php
index cb6211abda..5cb1d72a72 100644
--- a/phpBB/includes/mcp/mcp_ban.php
+++ b/phpBB/includes/mcp/mcp_ban.php
@@ -151,7 +151,7 @@ class mcp_ban
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=mcp_ban&amp;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);
}
}
}
diff --git a/phpBB/language/en/memberlist.php b/phpBB/language/en/memberlist.php
index ad4dd83ca4..b5b8434776 100644
--- a/phpBB/language/en/memberlist.php
+++ b/phpBB/language/en/memberlist.php
@@ -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',
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index 7f7657a3a4..aba14e04b8 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -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&amp;mode=overview&amp;u=' . $user_id, true, $user->session_id) : '',
+ 'U_USER_BAN' => ($auth->acl_get('m_ban')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=ban&amp;mode=user&amp;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&amp;u={$user_id}") : '',
'S_ZEBRA' => ($user->data['user_id'] != $user_id && $user->data['is_registered'] && $zebra_enabled) ? true : false,
diff --git a/phpBB/styles/prosilver/template/mcp_ban.html b/phpBB/styles/prosilver/template/mcp_ban.html
index c803ba253f..460c95e2a1 100644
--- a/phpBB/styles/prosilver/template/mcp_ban.html
+++ b/phpBB/styles/prosilver/template/mcp_ban.html
@@ -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>
diff --git a/phpBB/styles/prosilver/template/memberlist_view.html b/phpBB/styles/prosilver/template/memberlist_view.html
index 53f516b193..7df3eb6a91 100644
--- a/phpBB/styles/prosilver/template/memberlist_view.html
+++ b/phpBB/styles/prosilver/template/memberlist_view.html
@@ -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 -->