From 852d944cfba4c06dcc3af44d698f68c25425a07c Mon Sep 17 00:00:00 2001 From: FreddleSpl0it Date: Thu, 4 Apr 2024 16:27:48 +0200 Subject: [PATCH] [Web] remove f2b banlist from json_api.php --- data/web/admin.php | 2 +- data/web/f2b-banlist.php | 11 +++++++++++ data/web/json_api.php | 14 -------------- data/web/templates/admin/tab-config-f2b.twig | 2 +- 4 files changed, 13 insertions(+), 16 deletions(-) create mode 100644 data/web/f2b-banlist.php diff --git a/data/web/admin.php b/data/web/admin.php index 5dd7b3c6b..f03e52e76 100644 --- a/data/web/admin.php +++ b/data/web/admin.php @@ -104,7 +104,7 @@ $template_data = [ 'all_domains' => $all_domains, 'mailboxes' => $mailboxes, 'f2b_data' => $f2b_data, - 'f2b_banlist_url' => getBaseUrl() . "/api/v1/get/fail2ban/banlist/" . $f2b_data['banlist_id'], + 'f2b_banlist_url' => getBaseUrl() . "/f2b-banlist?id=" . $f2b_data['banlist_id'], 'q_data' => quarantine('settings'), 'qn_data' => quota_notification('get'), 'pw_reset_data' => reset_password('get_notification'), diff --git a/data/web/f2b-banlist.php b/data/web/f2b-banlist.php new file mode 100644 index 000000000..05c769907 --- /dev/null +++ b/data/web/f2b-banlist.php @@ -0,0 +1,11 @@ +getChallenge(); return; break; - case "fail2ban": - if (!isset($_SESSION['mailcow_cc_role'])){ - switch ($object) { - case 'banlist': - header('Content-Type: text/plain'); - echo fail2ban('banlist', 'get', $extra); - break; - } - } - break; } if (isset($_SESSION['mailcow_cc_role'])) { switch ($category) { @@ -1420,10 +1410,6 @@ if (isset($_GET['query'])) { break; case "fail2ban": switch ($object) { - case 'banlist': - header('Content-Type: text/plain'); - echo fail2ban('banlist', 'get', $extra); - break; default: $data = fail2ban('get'); process_get_return($data); diff --git a/data/web/templates/admin/tab-config-f2b.twig b/data/web/templates/admin/tab-config-f2b.twig index bb4a2e85a..75c626641 100644 --- a/data/web/templates/admin/tab-config-f2b.twig +++ b/data/web/templates/admin/tab-config-f2b.twig @@ -99,7 +99,7 @@ {% endif %}
- + {% if is_https %} {% endif %}