mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2026-11-05 16:29:32 +00:00
[Web] Add Netfilter unban all button
This commit is contained in:
4 files changed
+27
No files matched your search
@@ -145,6 +145,28 @@ function fail2ban($_action, $_data = null, $_extra = null) {
|
||||
);
|
||||
return true;
|
||||
}
|
||||
// Queue all automatic bans for unbanning, the denylist stays
|
||||
elseif ($_data['action'] == "unban-all") {
|
||||
try {
|
||||
foreach ($redis->hKeys('F2B_ACTIVE_BANS') as $network) {
|
||||
$redis->hSet('F2B_QUEUE_UNBAN', $network, 1);
|
||||
}
|
||||
}
|
||||
catch (RedisException $e) {
|
||||
$_SESSION['return'][] = array(
|
||||
'type' => 'danger',
|
||||
'log' => array(__FUNCTION__, $_action, $_data_log),
|
||||
'msg' => array('redis_error', $e)
|
||||
);
|
||||
return false;
|
||||
}
|
||||
$_SESSION['return'][] = array(
|
||||
'type' => 'success',
|
||||
'log' => array(__FUNCTION__, $_action, $_data_log),
|
||||
'msg' => 'f2b_modified'
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Start actions in dependency of network
|
||||
if (!empty($_data['network'])) {
|
||||
|
||||
Reference in new issue
Block a user