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,
|
||||
'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'),
|
||||
|
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();
|
||||
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);
|
||||
|
@ -99,7 +99,7 @@
|
||||
{% endif %}
|
||||
<form class="form-inline" data-id="f2b_banlist" role="form" method="post">
|
||||
<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 %}
|
||||
<button class="btn btn-secondary" type="button" onclick="copyToClipboard('banlist_url')"><i class="bi bi-clipboard"></i></button>
|
||||
{% endif %}
|
||||
|
Loading…
Reference in New Issue
Block a user