index.php 811 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. // Init
  3. error_reporting(NULL);
  4. ob_start();
  5. session_start();
  6. include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
  7. if ($_SESSION['user'] == 'admin') {
  8. if (!empty($_GET['user'])) {
  9. $user=$_GET['user'];
  10. }
  11. if (!empty($_GET['job'])) {
  12. $v_username = escapeshellarg($user);
  13. $v_job = escapeshellarg($_GET['job']);
  14. exec (VESTA_CMD."v-unsuspend-cron-job ".$v_username." ".$v_job, $output, $return_var);
  15. }
  16. if ($return_var != 0) {
  17. $error = implode('<br>', $output);
  18. if (empty($error)) $error = __('Error: vesta did not return any output.');
  19. $_SESSION['error_msg'] = $error;
  20. }
  21. unset($output);
  22. }
  23. $back=getenv("HTTP_REFERER");
  24. if (!empty($back)) {
  25. header("Location: ".$back);
  26. exit;
  27. }
  28. header("Location: /list/cron/");
  29. exit;