mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
Change bug #21825 - Banning/unbanning users now generates an entry in their user notes
Authorised by: acydburn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9602 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
c9cef63cc6
commit
3b181245b2
2 changed files with 20 additions and 3 deletions
|
@ -116,6 +116,7 @@
|
||||||
<li>[Change] Add index on log_time to the log table to prevent slowdown on boards with many log entries. (Bug #44665 - Patch by bantu)</li>
|
<li>[Change] Add index on log_time to the log table to prevent slowdown on boards with many log entries. (Bug #44665 - Patch by bantu)</li>
|
||||||
<li>[Change] Template engine now permits to a limited extent variable includes.</li>
|
<li>[Change] Template engine now permits to a limited extent variable includes.</li>
|
||||||
<li>[Change] Quote BBCode no longer requires the f_reply permission. (Bug #16079)</li>
|
<li>[Change] Quote BBCode no longer requires the f_reply permission. (Bug #16079)</li>
|
||||||
|
<li>[Change] Banning/unbanning users now generates an entry in their user notes (Bug #21825 - Patch by nickvergessen)</li>
|
||||||
<li>[Feature] Backported 3.2 captcha plugins.</li>
|
<li>[Feature] Backported 3.2 captcha plugins.</li>
|
||||||
<li>[Feature] Introduced new ACM plugins:
|
<li>[Feature] Introduced new ACM plugins:
|
||||||
<ul>
|
<ul>
|
||||||
|
|
|
@ -1072,9 +1072,16 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
|
||||||
// Update log
|
// Update log
|
||||||
$log_entry = ($ban_exclude) ? 'LOG_BAN_EXCLUDE_' : 'LOG_BAN_';
|
$log_entry = ($ban_exclude) ? 'LOG_BAN_EXCLUDE_' : 'LOG_BAN_';
|
||||||
|
|
||||||
// Add to moderator and admin log
|
// Add to moderator log, admin log and user notes
|
||||||
add_log('admin', $log_entry . strtoupper($mode), $ban_reason, $ban_list_log);
|
add_log('admin', $log_entry . strtoupper($mode), $ban_reason, $ban_list_log);
|
||||||
add_log('mod', 0, 0, $log_entry . strtoupper($mode), $ban_reason, $ban_list_log);
|
add_log('mod', 0, 0, $log_entry . strtoupper($mode), $ban_reason, $ban_list_log);
|
||||||
|
if ($mode == 'user')
|
||||||
|
{
|
||||||
|
foreach ($banlist_ary as $user_id)
|
||||||
|
{
|
||||||
|
add_log('user', $user_id, $log_entry . strtoupper($mode), $ban_reason, $ban_list_log);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$cache->destroy('sql', BANLIST_TABLE);
|
$cache->destroy('sql', BANLIST_TABLE);
|
||||||
|
|
||||||
|
@ -1113,7 +1120,7 @@ function user_unban($mode, $ban)
|
||||||
switch ($mode)
|
switch ($mode)
|
||||||
{
|
{
|
||||||
case 'user':
|
case 'user':
|
||||||
$sql = 'SELECT u.username AS unban_info
|
$sql = 'SELECT u.username AS unban_info, u.user_id
|
||||||
FROM ' . USERS_TABLE . ' u, ' . BANLIST_TABLE . ' b
|
FROM ' . USERS_TABLE . ' u, ' . BANLIST_TABLE . ' b
|
||||||
WHERE ' . $db->sql_in_set('b.ban_id', $unban_sql) . '
|
WHERE ' . $db->sql_in_set('b.ban_id', $unban_sql) . '
|
||||||
AND u.user_id = b.ban_userid';
|
AND u.user_id = b.ban_userid';
|
||||||
|
@ -1134,9 +1141,11 @@ function user_unban($mode, $ban)
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
$l_unban_list = '';
|
$l_unban_list = '';
|
||||||
|
$user_ids_ary = array();
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$l_unban_list .= (($l_unban_list != '') ? ', ' : '') . $row['unban_info'];
|
$l_unban_list .= (($l_unban_list != '') ? ', ' : '') . $row['unban_info'];
|
||||||
|
$user_ids_ary[] = $row['user_id'];
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
@ -1144,9 +1153,16 @@ function user_unban($mode, $ban)
|
||||||
WHERE ' . $db->sql_in_set('ban_id', $unban_sql);
|
WHERE ' . $db->sql_in_set('ban_id', $unban_sql);
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
// Add to moderator and admin log
|
// Add to moderator log, admin log and user notes
|
||||||
add_log('admin', 'LOG_UNBAN_' . strtoupper($mode), $l_unban_list);
|
add_log('admin', 'LOG_UNBAN_' . strtoupper($mode), $l_unban_list);
|
||||||
add_log('mod', 0, 0, 'LOG_UNBAN_' . strtoupper($mode), $l_unban_list);
|
add_log('mod', 0, 0, 'LOG_UNBAN_' . strtoupper($mode), $l_unban_list);
|
||||||
|
if ($mode == 'user')
|
||||||
|
{
|
||||||
|
foreach ($user_ids_ary as $user_id)
|
||||||
|
{
|
||||||
|
add_log('user', $user_id, 'LOG_UNBAN_' . strtoupper($mode), $l_unban_list);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$cache->destroy('sql', BANLIST_TABLE);
|
$cache->destroy('sql', BANLIST_TABLE);
|
||||||
|
|
Loading…
Add table
Reference in a new issue