mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-25 16:00:22 +01:00
commit
764729a99e
@ -686,6 +686,7 @@
|
||||
$config['error']['captcha'] = _('You seem to have mistyped the verification.');
|
||||
|
||||
// Moderator errors
|
||||
$config['error']['toomanyunban'] = _('You are only allowed to unban %s users at a time. You tried to unban %u users.');
|
||||
$config['error']['invalid'] = _('Invalid username and/or password.');
|
||||
$config['error']['notamod'] = _('You are not a mod…');
|
||||
$config['error']['invalidafter'] = _('Invalid username and/or password. Your user may have been deleted or changed.');
|
||||
@ -769,6 +770,9 @@
|
||||
* ====================
|
||||
*/
|
||||
|
||||
// Limit how many bans can be removed via the ban list. (Set too -1 to remove limit.)
|
||||
$config['mod']['unban_limit'] = 5;
|
||||
|
||||
// Whether or not to lock moderator sessions to the IP address that was logged in with.
|
||||
$config['mod']['lock_ip'] = true;
|
||||
|
||||
|
@ -651,6 +651,20 @@ function mod_bans($page_no = 1) {
|
||||
if (preg_match('/^ban_(\d+)$/', $name, $match))
|
||||
$unban[] = $match[1];
|
||||
}
|
||||
if (isset($config['mod']['unban_limit'])){
|
||||
if (count($unban) <= $config['mod']['unban_limit'] || $config['mod']['unban_limit'] == -1){
|
||||
if (!empty($unban)) {
|
||||
query('DELETE FROM `bans` WHERE `id` = ' . implode(' OR `id` = ', $unban)) or error(db_error());
|
||||
|
||||
foreach ($unban as $id) {
|
||||
modLog("Removed ban #{$id}");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
error(sprintf($config['error']['toomanyunban'], $config['mod']['unban_limit'], count($unban) ));
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if (!empty($unban)) {
|
||||
query('DELETE FROM `bans` WHERE `id` = ' . implode(' OR `id` = ', $unban)) or error(db_error());
|
||||
@ -660,6 +674,7 @@ function mod_bans($page_no = 1) {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
header('Location: ?/bans', true, $config['redirect_http']);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user