2014-10-05 14:52:15 +03:00
|
|
|
<?php
|
|
|
|
// Init
|
|
|
|
error_reporting(NULL);
|
|
|
|
ob_start();
|
|
|
|
session_start();
|
|
|
|
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
|
|
|
|
2015-06-03 02:31:03 +03:00
|
|
|
// Check token
|
|
|
|
if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) {
|
|
|
|
header('location: /login/');
|
2015-12-11 21:14:49 +02:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!empty($_GET['rule'])) {
|
2015-12-11 21:14:49 +02:00
|
|
|
$v_rule = escapeshellarg($_GET['rule']);
|
|
|
|
exec (VESTA_CMD."v-suspend-firewall-rule ".$v_rule, $output, $return_var);
|
2014-10-05 14:52:15 +03:00
|
|
|
}
|
2015-12-11 21:14:49 +02:00
|
|
|
check_return_code($return_var,$output);
|
|
|
|
unset($output);
|
2014-10-05 14:52:15 +03:00
|
|
|
|
2015-12-11 21:14:49 +02:00
|
|
|
$back=getenv("HTTP_REFERER");
|
2014-10-05 14:52:15 +03:00
|
|
|
if (!empty($back)) {
|
2015-12-11 21:14:49 +02:00
|
|
|
header("Location: ".$back);
|
2014-10-05 14:52:15 +03:00
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
header("Location: /list/firewall/");
|
|
|
|
exit;
|