index.php 545 B

123456789101112131415161718192021222324
  1. <?php
  2. // Init
  3. error_reporting(NULL);
  4. ob_start();
  5. session_start();
  6. include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
  7. $pkg = $_POST['pkg'];
  8. $action = $_POST['action'];
  9. if ($_SESSION['user'] == 'admin') {
  10. switch ($action) {
  11. case 'update': $cmd='v-update-sys-vesta';
  12. break;
  13. default: header("Location: /list/updates/"); exit;
  14. }
  15. foreach ($pkg as $value) {
  16. $value = escapeshellarg($value);
  17. exec (VESTA_CMD.$cmd." ".$value, $output, $return_var);
  18. }
  19. }
  20. header("Location: /list/updates/");