mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-14 10:37:39 -07:00
Updated services and fixed minor bugs.
This commit is contained in:
parent
4306a4fb4f
commit
2a12fec5ea
90 changed files with 1706 additions and 3 deletions
31
web/api/v1/bulk/backup/exclusions/index.php
Normal file
31
web/api/v1/bulk/backup/exclusions/index.php
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
// Init
|
||||
error_reporting(NULL);
|
||||
ob_start();
|
||||
session_start();
|
||||
header('Content-Type: application/json');
|
||||
|
||||
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
||||
|
||||
$backup = $_POST['system'];
|
||||
$action = $_POST['action'];
|
||||
|
||||
switch ($action) {
|
||||
case 'delete': $cmd='v-delete-user-backup-exclusions';
|
||||
break;
|
||||
default: exit;
|
||||
}
|
||||
|
||||
foreach ($backup as $value) {
|
||||
$value = escapeshellarg($value);
|
||||
exec (VESTA_CMD.$cmd." ".$user." ".$value, $output, $return_var);
|
||||
}
|
||||
|
||||
$result = array(
|
||||
'error' => $_SESSION['error_msg'],
|
||||
'ok_msg' => $_SESSION['ok_msg']
|
||||
);
|
||||
|
||||
echo json_encode($result);
|
||||
unset($_SESSION['error_msg']);
|
||||
unset($_SESSION['ok_msg']);
|
44
web/api/v1/bulk/firewall/banlist/index.php
Normal file
44
web/api/v1/bulk/firewall/banlist/index.php
Normal file
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
// Init
|
||||
error_reporting(NULL);
|
||||
ob_start();
|
||||
session_start();
|
||||
header('Content-Type: application/json');
|
||||
|
||||
// Main include
|
||||
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
||||
|
||||
// Check token
|
||||
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
|
||||
exit();
|
||||
}
|
||||
|
||||
// Check user
|
||||
if ($_SESSION['user'] != 'admin') {
|
||||
exit;
|
||||
}
|
||||
|
||||
$ipchain = $_POST['ipchain'];
|
||||
$action = $_POST['action'];
|
||||
|
||||
switch ($action) {
|
||||
case 'delete': $cmd='v-delete-firewall-ban';
|
||||
break;
|
||||
default: 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);
|
||||
}
|
||||
|
||||
$result = array(
|
||||
'error' => $_SESSION['error_msg'],
|
||||
'ok_msg' => $_SESSION['ok_msg']
|
||||
);
|
||||
|
||||
echo json_encode($result);
|
||||
unset($_SESSION['error_msg']);
|
||||
unset($_SESSION['ok_msg']);
|
Loading…
Add table
Add a link
Reference in a new issue