diff --git a/web/api/v1/add/firewall/banlist/index.php b/web/api/v1/add/firewall/banlist/index.php index 608f8f9f1..e60b8066c 100644 --- a/web/api/v1/add/firewall/banlist/index.php +++ b/web/api/v1/add/firewall/banlist/index.php @@ -61,6 +61,8 @@ $result = array( 'ok_msg' => $_SESSION['ok_msg'] ); +echo json_encode($result); + // Flush session messages unset($_SESSION['error_msg']); unset($_SESSION['ok_msg']); diff --git a/web/api/v1/delete/cron/autoupdate/index.php b/web/api/v1/delete/cron/autoupdate/index.php index 33fe87b52..f26de9987 100644 --- a/web/api/v1/delete/cron/autoupdate/index.php +++ b/web/api/v1/delete/cron/autoupdate/index.php @@ -11,7 +11,7 @@ $error = ''; // Check token if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) { - exit(); + $error = 'Unauthenticated'; } if ($_SESSION['user'] == 'admin') { diff --git a/web/api/v1/delete/cron/reports/index.php b/web/api/v1/delete/cron/reports/index.php index ef664240f..7ab5db428 100644 --- a/web/api/v1/delete/cron/reports/index.php +++ b/web/api/v1/delete/cron/reports/index.php @@ -11,7 +11,7 @@ $error = ''; // Check token if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) { - exit(); + $error = 'Unathenticated'; } exec (VESTA_CMD."v-delete-cron-reports ".$user, $output, $return_var); diff --git a/web/api/v1/list/firewall/banlist/index.php b/web/api/v1/list/firewall/banlist/index.php index 5b92826c4..54136bb21 100644 --- a/web/api/v1/list/firewall/banlist/index.php +++ b/web/api/v1/list/firewall/banlist/index.php @@ -9,7 +9,6 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); // Check user if ($_SESSION['user'] != 'admin') { - header("Location: /list/user"); exit; } @@ -18,9 +17,10 @@ exec (VESTA_CMD."v-list-firewall-ban json", $output, $return_var); $data = json_decode(implode('', $output), true); $data = array_reverse($data, true); unset($output); -$i = 0; foreach ($data as $key => $value) { + ++$i; + if ($data[$key]['SUSPENDED'] == 'yes') { $data[$key]['status'] = 'suspended'; $data[$key]['suspend_action'] = 'unsuspend' ; @@ -32,22 +32,19 @@ foreach ($data as $key => $value) { } $data[$key]['delete_url'] = '/delete/firewall/banlist/?ip='.$data[$key]['ip'].'&chain='.$data[$key]['CHAIN'].'&token='.$_SESSION['token']; + $data[$key]['delete_confirmation'] = __('DELETE_IP_CONFIRMATION',$key); if ( $i == 1) { $total_amount = __('1 rule'); } else { $total_amount = __('%s rules',$i); } - ++$i; } if ($i == 0) { $total_amount = __('There are no currently banned IP'); } -// Render page -// render_page($user, $TAB, 'list_firewall_banlist'); - // Back uri $_SESSION['back'] = $_SERVER['REQUEST_URI'];