mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-14 18:49:17 -07:00
Integrated new api interface.
This commit is contained in:
parent
4a9bfc94ad
commit
4306a4fb4f
116 changed files with 10371 additions and 0 deletions
27
web/api/v1/add/cron/autoupdate/index.php
Normal file
27
web/api/v1/add/cron/autoupdate/index.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
// Init
|
||||
error_reporting(NULL);
|
||||
ob_start();
|
||||
session_start();
|
||||
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
||||
|
||||
$message = '';
|
||||
$error = '';
|
||||
|
||||
// Check token
|
||||
if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) {
|
||||
$error = 'Unauthenticated.';
|
||||
}
|
||||
|
||||
if ($_SESSION['user'] == 'admin') {
|
||||
exec (VESTA_CMD."v-add-cron-vesta-autoupdate", $output, $return_var);
|
||||
$message = __('Autoupdate has been successfully enabled');
|
||||
unset($output);
|
||||
}
|
||||
|
||||
$result = array(
|
||||
'message' => $message,
|
||||
'error' => $error,
|
||||
);
|
||||
|
||||
print json_encode($result);
|
Loading…
Add table
Add a link
Reference in a new issue