mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 14:23:57 -07:00
feat: Allow setting custom ban reason when banning users
This commit is contained in:
parent
af9bf7382c
commit
0c15aaec17
2 changed files with 9 additions and 1 deletions
|
@ -29,7 +29,11 @@ if ($submit) {
|
|||
}
|
||||
|
||||
if (!getBanInfo((int)$this_userdata['user_id'])) {
|
||||
$sql = 'INSERT INTO ' . BB_BANLIST . ' (ban_userid) VALUES (' . $this_userdata['user_id'] . ')';
|
||||
$ban_reason = '';
|
||||
if (!empty($_POST['ban_reason'])) {
|
||||
$ban_reason = trim($_POST['ban_reason']);
|
||||
}
|
||||
$sql = 'INSERT INTO ' . BB_BANLIST . ' (ban_userid, ban_reason) VALUES (' . $this_userdata['user_id'] . ', "' . DB()->escape($ban_reason) . '")';
|
||||
if (!DB()->sql_query($sql)) {
|
||||
bb_die('Could not insert ban_userid info into database');
|
||||
}
|
||||
|
|
|
@ -13,6 +13,10 @@
|
|||
<td class="row1">{L_USERNAME}:</td>
|
||||
<td class="row2"><input type="text" class="post" name="username" maxlength="50" size="20" /> <input type="hidden" name="mode" value="edit" />{S_HIDDEN_FIELDS} <input type="submit" name="usersubmit" value="{L_FIND_USERNAME}" class="liteoption" onClick="window.open('{U_SEARCH_USER}', '_bbsearch', 'HEIGHT=250,resizable=yes,WIDTH=400');return false;" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1">{L_REASON}:</td>
|
||||
<td class="row2"><input type="text" class="post" name="ban_reason" maxlength="255" size="80" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2">{L_UNBAN_USERNAME}</th>
|
||||
</tr>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue