index.php 955 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. // Init
  3. error_reporting(NULL);
  4. ob_start();
  5. session_start();
  6. include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
  7. $job = $_POST['job'];
  8. $action = $_POST['action'];
  9. if ($_SESSION['user'] == 'admin') {
  10. switch ($action) {
  11. case 'delete': $cmd='v-delete-cron-job';
  12. break;
  13. case 'suspend': $cmd='v-suspend-cron-job';
  14. break;
  15. case 'unsuspend': $cmd='v-unsuspend-cron-job';
  16. break;
  17. default: header("Location: /list/cron/"); exit;
  18. }
  19. } else {
  20. switch ($action) {
  21. case 'delete': $cmd='v-delete-cron-job';
  22. break;
  23. default: header("Location: /list/cron/"); exit;
  24. }
  25. }
  26. foreach ($job as $value) {
  27. $value = escapeshellarg($value);
  28. exec (VESTA_CMD.$cmd." ".$user." ".$value." no", $output, $return_var);
  29. $restart = 'yes';
  30. }
  31. if (!empty($restart)) {
  32. exec (VESTA_CMD."v-restart-cron", $output, $return_var);
  33. }
  34. header("Location: /list/cron/");