mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-20 21:34:11 -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
28
web/api/v1/delete/backup/exclusion/index.php
Normal file
28
web/api/v1/delete/backup/exclusion/index.php
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
// Init
|
||||
error_reporting(NULL);
|
||||
ob_start();
|
||||
session_start();
|
||||
header('Content-Type: application/json');
|
||||
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
||||
|
||||
if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) {
|
||||
$user=$_GET['user'];
|
||||
}
|
||||
|
||||
if (!empty($_GET['system'])) {
|
||||
$v_username = escapeshellarg($user);
|
||||
$v_system = escapeshellarg($_GET['system']);
|
||||
exec (VESTA_CMD."v-delete-user-backup-exclusions ".$v_username." ".$v_system, $output, $return_var);
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
|
||||
$result = array(
|
||||
'error' => $_SESSION['error_msg'],
|
||||
'ok_msg' => $_SESSION['ok_msg']
|
||||
);
|
||||
|
||||
echo json_encode($result);
|
||||
unset($_SESSION['error_msg']);
|
||||
unset($_SESSION['ok_msg']);
|
28
web/api/v1/delete/cron/autoupdate/index.php
Normal file
28
web/api/v1/delete/cron/autoupdate/index.php
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
// Init
|
||||
error_reporting(NULL);
|
||||
ob_start();
|
||||
session_start();
|
||||
header('Content-Type: application/json');
|
||||
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
||||
|
||||
$message = '';
|
||||
$error = '';
|
||||
|
||||
// Check token
|
||||
if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) {
|
||||
exit();
|
||||
}
|
||||
|
||||
if ($_SESSION['user'] == 'admin') {
|
||||
exec (VESTA_CMD."v-delete-cron-vesta-autoupdate", $output, $return_var);
|
||||
$message = __('Autoupdate has been successfully disabled');
|
||||
unset($output);
|
||||
}
|
||||
|
||||
$result = array(
|
||||
'message' => $message,
|
||||
'error' => $error
|
||||
);
|
||||
|
||||
print json_encode($result);
|
26
web/api/v1/delete/cron/reports/index.php
Normal file
26
web/api/v1/delete/cron/reports/index.php
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
// Init
|
||||
error_reporting(NULL);
|
||||
ob_start();
|
||||
session_start();
|
||||
header('Content-Type: application/json');
|
||||
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
||||
|
||||
$message = '';
|
||||
$error = '';
|
||||
|
||||
// Check token
|
||||
if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) {
|
||||
exit();
|
||||
}
|
||||
|
||||
exec (VESTA_CMD."v-delete-cron-reports ".$user, $output, $return_var);
|
||||
$message = __('Cronjob email reporting has been successfully disabled');
|
||||
unset($output);
|
||||
|
||||
$result = array(
|
||||
'message' => $message,
|
||||
'error' => $error,
|
||||
);
|
||||
|
||||
print json_encode($result);
|
36
web/api/v1/delete/firewall/banlist/index.php
Normal file
36
web/api/v1/delete/firewall/banlist/index.php
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
// Init
|
||||
error_reporting(NULL);
|
||||
ob_start();
|
||||
session_start();
|
||||
header('Content-Type: application/json');
|
||||
|
||||
// Main include
|
||||
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
||||
|
||||
// Check user
|
||||
if ($_SESSION['user'] != 'admin') {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Check token
|
||||
if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) {
|
||||
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);
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
|
||||
$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