1
0
mirror of https://github.com/serghey-rodin/vesta.git synced 2025-03-12 04:36:25 -07:00

39 lines
852 B
PHP
Raw Normal View History

2014-10-05 14:52:15 +03:00
<?php
// Init
error_reporting(NULL);
ob_start();
session_start();
// Main include
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
2015-06-03 02:31:03 +03:00
// Check token
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
header('location: /login/');
exit();
2015-06-03 02:31:03 +03:00
}
2014-10-05 14:52:15 +03:00
// Check user
if ($_SESSION['user'] != 'admin') {
header("Location: /list/user");
exit;
}
2015-06-21 20:28:55 +03:00
$ipchain = $_POST['ipchain'];
2014-10-05 14:52:15 +03:00
$action = $_POST['action'];
switch ($action) {
case 'delete': $cmd='v-delete-firewall-ban';
break;
default: header("Location: /list/firewall/banlist/"); exit;
}
foreach ($ipchain as $value) {
list($ip,$chain) = explode(":",$value);
$v_ip = escapeshellarg($ip);
$v_chain = escapeshellarg($chain);
exec (VESTA_CMD.$cmd." ".$v_ip." ".$v_chain, $output, $return_var);
2014-10-05 14:52:15 +03:00
}
header("Location: /list/firewall/banlist");