|
5 | 5 | session_start(); |
6 | 6 | include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); |
7 | 7 |
|
8 | | - // Delete as someone else? |
9 | | - if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) { |
10 | | - $user=$_GET['user']; |
11 | | - } |
| 8 | +// Delete as someone else? |
| 9 | +if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) { |
| 10 | + $user=$_GET['user']; |
| 11 | +} |
12 | 12 |
|
13 | | - // DNS domain |
14 | | - if ((!empty($_GET['domain'])) && (empty($_GET['record_id']))) { |
15 | | - $v_username = escapeshellarg($user); |
16 | | - $v_domain = escapeshellarg($_GET['domain']); |
17 | | - exec (VESTA_CMD."v-delete-dns-domain ".$v_username." ".$v_domain, $output, $return_var); |
18 | | - if ($return_var != 0) { |
19 | | - $error = implode('<br>', $output); |
20 | | - if (empty($error)) $error = __('Error: vesta did not return any output.'); |
21 | | - $_SESSION['error_msg'] = $error; |
22 | | - } |
23 | | - unset($output); |
| 13 | +// DNS domain |
| 14 | +if ((!empty($_GET['domain'])) && (empty($_GET['record_id']))) { |
| 15 | + $v_username = escapeshellarg($user); |
| 16 | + $v_domain = escapeshellarg($_GET['domain']); |
| 17 | + exec (VESTA_CMD."v-delete-dns-domain ".$v_username." ".$v_domain, $output, $return_var); |
| 18 | + check_return_code($return_var,$output); |
| 19 | + unset($output); |
24 | 20 |
|
25 | | - $back = $_SESSION['back']; |
26 | | - if (!empty($back)) { |
27 | | - header("Location: ".$back); |
28 | | - exit; |
29 | | - } |
30 | | - header("Location: /list/dns/"); |
| 21 | + $back = $_SESSION['back']; |
| 22 | + if (!empty($back)) { |
| 23 | + header("Location: ".$back); |
31 | 24 | exit; |
32 | 25 | } |
| 26 | + header("Location: /list/dns/"); |
| 27 | + exit; |
| 28 | +} |
33 | 29 |
|
34 | | - // DNS record |
35 | | - if ((!empty($_GET['domain'])) && (!empty($_GET['record_id']))) { |
36 | | - $v_username = escapeshellarg($user); |
37 | | - $v_domain = escapeshellarg($_GET['domain']); |
38 | | - $v_record_id = escapeshellarg($_GET['record_id']); |
39 | | - exec (VESTA_CMD."v-delete-dns-record ".$v_username." ".$v_domain." ".$v_record_id, $output, $return_var); |
40 | | - if ($return_var != 0) { |
41 | | - $error = implode('<br>', $output); |
42 | | - if (empty($error)) $error = __('Error: vesta did not return any output.'); |
43 | | - $_SESSION['error_msg'] = $error; |
44 | | - } |
45 | | - unset($output); |
46 | | - $back = $_SESSION['back']; |
47 | | - if (!empty($back)) { |
48 | | - header("Location: ".$back); |
49 | | - exit; |
50 | | - } |
51 | | - header("Location: /list/dns/?domain=".$_GET['domain']); |
| 30 | +// DNS record |
| 31 | +if ((!empty($_GET['domain'])) && (!empty($_GET['record_id']))) { |
| 32 | + $v_username = escapeshellarg($user); |
| 33 | + $v_domain = escapeshellarg($_GET['domain']); |
| 34 | + $v_record_id = escapeshellarg($_GET['record_id']); |
| 35 | + exec (VESTA_CMD."v-delete-dns-record ".$v_username." ".$v_domain." ".$v_record_id, $output, $return_var); |
| 36 | + check_return_code($return_var,$output); |
| 37 | + unset($output); |
| 38 | + $back = $_SESSION['back']; |
| 39 | + if (!empty($back)) { |
| 40 | + header("Location: ".$back); |
52 | 41 | exit; |
53 | 42 | } |
54 | | -//} |
| 43 | + header("Location: /list/dns/?domain=".$_GET['domain']); |
| 44 | + exit; |
| 45 | +} |
55 | 46 |
|
56 | 47 | $back = $_SESSION['back']; |
57 | 48 | if (!empty($back)) { |
|
0 commit comments