mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 10:37:42 -07:00
🔒 ♻️ Implement secure exec
wrapper functions.
This commit is contained in:
parent
6e13036780
commit
8e951ac72e
115 changed files with 1345 additions and 1986 deletions
|
@ -16,20 +16,18 @@ if ($_SESSION['user'] != 'admin') {
|
|||
// Check token
|
||||
if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) {
|
||||
header('location: /login/');
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
|
||||
if ((!empty($_GET['ip'])) && (!empty($_GET['chain']))) {
|
||||
$v_ip = escapeshellarg($_GET['ip']);
|
||||
$v_chain = escapeshellarg($_GET['chain']);
|
||||
exec (VESTA_CMD."v-delete-firewall-ban ".$v_ip." ".$v_chain, $output, $return_var);
|
||||
$v_ip = $_GET['ip'];
|
||||
$v_chain = $_GET['chain'];
|
||||
v_exec('v-delete-firewall-ban', [$v_ip, $v_chain]);
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
|
||||
$back = $_SESSION['back'];
|
||||
if (!empty($back)) {
|
||||
header("Location: ".$back);
|
||||
header("Location: $back");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,19 +16,17 @@ if ($_SESSION['user'] != 'admin') {
|
|||
// Check token
|
||||
if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) {
|
||||
header('location: /login/');
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!empty($_GET['rule'])) {
|
||||
$v_rule = escapeshellarg($_GET['rule']);
|
||||
exec (VESTA_CMD."v-delete-firewall-rule ".$v_rule, $output, $return_var);
|
||||
$v_rule = $_GET['rule'];
|
||||
v_exec('v-delete-firewall-rule', [$v_rule]);
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
|
||||
$back = $_SESSION['back'];
|
||||
if (!empty($back)) {
|
||||
header("Location: ".$back);
|
||||
header("Location: $back");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue