vesta/web/delete/cron/index.php

34 lines
740 B
PHP
Raw Permalink Normal View History

2013-01-18 18:23:04 +04:00
<?php
// Init
error_reporting(NULL);
ob_start();
session_start();
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
2013-10-29 23:12:47 +02:00
if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) {
$user=$_GET['user'];
2013-10-29 23:12:47 +02:00
}
2013-01-18 18:23:04 +04:00
2015-06-03 02:31:03 +03:00
// Check token
if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) {
header('location: /login/');
exit();
2015-06-03 02:31:03 +03:00
}
2013-10-29 23:12:47 +02:00
if (!empty($_GET['job'])) {
$v_username = escapeshellarg($user);
$v_job = escapeshellarg($_GET['job']);
exec (VESTA_CMD."v-delete-cron-job ".$v_username." ".$v_job, $output, $return_var);
2013-10-29 23:12:47 +02:00
}
check_return_code($return_var,$output);
unset($output);
2013-01-18 18:23:04 +04:00
$back = $_SESSION['back'];
if (!empty($back)) {
header("Location: ".$back);
2013-01-18 18:23:04 +04:00
exit;
}
header("Location: /list/cron/");
exit;