index.php 810 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. // Check token
  8. if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) {
  9. header('location: /login/');
  10. exit();
  11. }
  12. // Check user
  13. if ($_SESSION['user'] != 'admin') {
  14. header("Location: /list/user");
  15. exit;
  16. }
  17. if (!empty($_GET['user'])) {
  18. $user=$_GET['user'];
  19. }
  20. if (!empty($_GET['job'])) {
  21. $v_username = escapeshellarg($user);
  22. $v_job = escapeshellarg($_GET['job']);
  23. exec (VESTA_CMD."v-unsuspend-cron-job ".$v_username." ".$v_job, $output, $return_var);
  24. }
  25. check_return_code($return_var,$output);
  26. unset($output);
  27. $back=getenv("HTTP_REFERER");
  28. if (!empty($back)) {
  29. header("Location: ".$back);
  30. exit;
  31. }
  32. header("Location: /list/cron/");
  33. exit;