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

65 lines
1.6 KiB
PHP
Raw Permalink Normal View History

2013-01-19 23:57:58 +04:00
<?php
// Init
error_reporting(NULL);
ob_start();
session_start();
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
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
}
2014-10-05 14:40:30 +03:00
// Check user
if ($_SESSION['user'] != 'admin') {
header("Location: /list/user");
exit;
}
if (!empty($_GET['user'])) {
$user=$_GET['user'];
}
2013-01-19 23:57:58 +04:00
2014-10-05 14:40:30 +03:00
// DNS domain
if ((!empty($_GET['domain'])) && (empty($_GET['record_id']))) {
$v_username = escapeshellarg($user);
$v_domain = escapeshellarg($_GET['domain']);
exec (VESTA_CMD."v-suspend-dns-domain ".$v_username." ".$v_domain, $output, $return_var);
check_return_code($return_var,$output);
unset($output);
2014-10-05 14:40:30 +03:00
$back = $_SESSION['back'];
if (!empty($back)) {
header("Location: ".$back);
2013-01-19 23:57:58 +04:00
exit;
}
2014-10-05 14:40:30 +03:00
header("Location: /list/dns/");
exit;
}
2013-01-19 23:57:58 +04:00
2014-10-05 14:40:30 +03: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-suspend-dns-record ".$v_username." ".$v_domain." ".$v_record_id, $output, $return_var);
check_return_code($return_var,$output);
unset($output);
2014-10-05 14:40:30 +03:00
$back = $_SESSION['back'];
if (!empty($back)) {
header("Location: ".$back);
2013-01-19 23:57:58 +04:00
exit;
}
2014-10-05 14:40:30 +03:00
header("Location: /list/dns/?domain=".$_GET['domain']);
exit;
2013-01-19 23:57:58 +04:00
}
2014-10-05 14:40:30 +03:00
2013-01-19 23:57:58 +04:00
$back = $_SESSION['back'];
if (!empty($back)) {
header("Location: ".$back);
2013-01-19 23:57:58 +04:00
exit;
}
header("Location: /list/dns/");
exit;