1
0
mirror of https://github.com/serghey-rodin/vesta.git synced 2025-03-12 04:36:25 -07:00

61 lines
1.5 KiB
PHP
Raw 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
// Delete as someone else?
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
// DNS domain
if ((!empty($_GET['domain'])) && (empty($_GET['record_id']))) {
$v_username = escapeshellarg($user);
$v_domain = escapeshellarg($_GET['domain']);
exec (VESTA_CMD."v-delete-dns-domain ".$v_username." ".$v_domain, $output, $return_var);
check_return_code($return_var,$output);
unset($output);
2013-01-18 18:23:04 +04:00
2013-10-29 23:12:47 +02:00
$back = $_SESSION['back'];
if (!empty($back)) {
header("Location: ".$back);
2013-01-18 18:23:04 +04:00
exit;
}
2013-10-29 23:12:47 +02:00
header("Location: /list/dns/");
exit;
}
2013-01-18 18:23:04 +04:00
2013-10-29 23:12:47 +02:00
// DNS record
if ((!empty($_GET['domain'])) && (!empty($_GET['record_id']))) {
$v_username = escapeshellarg($user);
$v_domain = escapeshellarg($_GET['domain']);
$v_record_id = escapeshellarg($_GET['record_id']);
exec (VESTA_CMD."v-delete-dns-record ".$v_username." ".$v_domain." ".$v_record_id, $output, $return_var);
check_return_code($return_var,$output);
unset($output);
2013-10-29 23:12:47 +02:00
$back = $_SESSION['back'];
if (!empty($back)) {
header("Location: ".$back);
2013-01-18 18:23:04 +04:00
exit;
}
2013-10-29 23:12:47 +02:00
header("Location: /list/dns/?domain=".$_GET['domain']);
exit;
}
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/dns/");
exit;