Files
VestaCP/web/bulk/vesta/index.php

32 lines
685 B
PHP
Raw Normal View History

2013-02-01 17:30:39 +02: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($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
header('location: /login/');
exit();
2015-06-03 02:31:03 +03:00
}
2013-02-01 17:30:39 +02:00
$pkg = $_POST['pkg'];
$action = $_POST['action'];
if ($_SESSION['user'] == 'admin') {
switch ($action) {
case 'update': $cmd='v-update-sys-vesta';
break;
default: header("Location: /list/updates/"); exit;
}
foreach ($pkg as $value) {
$value = escapeshellarg($value);
exec (VESTA_CMD.$cmd." ".$value, $output, $return_var);
2013-02-01 17:30:39 +02:00
}
}
header("Location: /list/updates/");