mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2024-12-23 02:04:46 +02:00
Merge pull request #6168 from mailcow/fix/f2b-banlist
[Web] remove f2b banlist from json_api.php
This commit is contained in:
commit
922f8777b0
@ -104,7 +104,7 @@ $template_data = [
|
|||||||
'all_domains' => $all_domains,
|
'all_domains' => $all_domains,
|
||||||
'mailboxes' => $mailboxes,
|
'mailboxes' => $mailboxes,
|
||||||
'f2b_data' => $f2b_data,
|
'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'),
|
'q_data' => quarantine('settings'),
|
||||||
'qn_data' => quota_notification('get'),
|
'qn_data' => quota_notification('get'),
|
||||||
'pw_reset_data' => reset_password('get_notification'),
|
'pw_reset_data' => reset_password('get_notification'),
|
||||||
|
11
data/web/f2b-banlist.php
Normal file
11
data/web/f2b-banlist.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/prerequisites.inc.php';
|
||||||
|
|
||||||
|
if (isset($_GET['id'])) {
|
||||||
|
header('Content-Type: text/plain');
|
||||||
|
echo fail2ban('banlist', 'get', $_GET['id']);
|
||||||
|
} else {
|
||||||
|
header('HTTP/1.1 404 Not Found');
|
||||||
|
exit;
|
||||||
|
}
|
@ -510,16 +510,6 @@ if (isset($_GET['query'])) {
|
|||||||
$_SESSION['challenge'] = $WebAuthn->getChallenge();
|
$_SESSION['challenge'] = $WebAuthn->getChallenge();
|
||||||
return;
|
return;
|
||||||
break;
|
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'])) {
|
if (isset($_SESSION['mailcow_cc_role'])) {
|
||||||
switch ($category) {
|
switch ($category) {
|
||||||
@ -1420,10 +1410,6 @@ if (isset($_GET['query'])) {
|
|||||||
break;
|
break;
|
||||||
case "fail2ban":
|
case "fail2ban":
|
||||||
switch ($object) {
|
switch ($object) {
|
||||||
case 'banlist':
|
|
||||||
header('Content-Type: text/plain');
|
|
||||||
echo fail2ban('banlist', 'get', $extra);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
$data = fail2ban('get');
|
$data = fail2ban('get');
|
||||||
process_get_return($data);
|
process_get_return($data);
|
||||||
|
@ -99,7 +99,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
<form class="form-inline" data-id="f2b_banlist" role="form" method="post">
|
<form class="form-inline" data-id="f2b_banlist" role="form" method="post">
|
||||||
<div class="input-group mb-3">
|
<div class="input-group mb-3">
|
||||||
<input type="text" class="form-control" aria-label="Banlist url" value="{{ f2b_banlist_url}}" id="banlist_url">
|
<input type="text" class="form-control" aria-label="Banlist url" value="{{ f2b_banlist_url }}" id="banlist_url">
|
||||||
{% if is_https %}
|
{% if is_https %}
|
||||||
<button class="btn btn-secondary" type="button" onclick="copyToClipboard('banlist_url')"><i class="bi bi-clipboard"></i></button>
|
<button class="btn btn-secondary" type="button" onclick="copyToClipboard('banlist_url')"><i class="bi bi-clipboard"></i></button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -299,7 +299,7 @@ fix_broken_dnslist_conf() {
|
|||||||
echo -e "\e[35mOk, not deleting it! Please make sure you take a look at postfix upon start then..."
|
echo -e "\e[35mOk, not deleting it! Please make sure you take a look at postfix upon start then..."
|
||||||
return 2
|
return 2
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user