index.php 593 B

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