mirror of
https://github.com/SubleXBle/Fail2Ban-Report.git
synced 2026-02-10 02:38:42 -06:00
Update action_unban-ip.php
added support for multiple jail blocklists
This commit is contained in:
@@ -5,15 +5,18 @@ header('Content-Type: application/json; charset=utf-8');
|
||||
|
||||
require_once __DIR__ . '/../unblock-ip.php';
|
||||
|
||||
if (!isset($_POST['ip'])) {
|
||||
// Validate input
|
||||
if (!isset($_POST['ip']) || !isset($_POST['jail'])) {
|
||||
http_response_code(400);
|
||||
echo json_encode(['success' => false, 'message' => 'Missing IP address']);
|
||||
echo json_encode(['success' => false, 'message' => 'Missing IP address or jail']);
|
||||
exit;
|
||||
}
|
||||
|
||||
$ip = trim($_POST['ip']);
|
||||
$jail = trim($_POST['jail']);
|
||||
|
||||
$result = unblockIp($ip);
|
||||
// Call the unblock function with jail context
|
||||
$result = unblockIp($ip, $jail);
|
||||
|
||||
if ($result['success']) {
|
||||
echo json_encode(['success' => true, 'message' => $result['message']]);
|
||||
|
||||
Reference in New Issue
Block a user