|
5 | 5 | session_start(); |
6 | 6 | include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); |
7 | 7 |
|
8 | | -if ($_SESSION['user'] == 'admin') { |
9 | | - if (!empty($_GET['user'])) { |
10 | | - $user=$_GET['user']; |
11 | | - } |
| 8 | +// Check user |
| 9 | +if ($_SESSION['user'] != 'admin') { |
| 10 | + header("Location: /list/user"); |
| 11 | + exit; |
| 12 | +} |
12 | 13 |
|
13 | | - // Mail domain |
14 | | - if ((!empty($_GET['domain'])) && (empty($_GET['account']))) { |
15 | | - $v_username = escapeshellarg($user); |
16 | | - $v_domain = escapeshellarg($_GET['domain']); |
17 | | - exec (VESTA_CMD."v-suspend-mail-domain ".$v_username." ".$v_domain, $output, $return_var); |
18 | | - check_return_code($return_var,$output); |
19 | | - unset($output); |
20 | | - $back=getenv("HTTP_REFERER"); |
21 | | - if (!empty($back)) { |
22 | | - header("Location: ".$back); |
23 | | - exit; |
24 | | - } |
25 | | - header("Location: /list/mail/"); |
| 14 | +if (!empty($_GET['user'])) { |
| 15 | + $user=$_GET['user']; |
| 16 | +} |
| 17 | + |
| 18 | +// Mail domain |
| 19 | +if ((!empty($_GET['domain'])) && (empty($_GET['account']))) { |
| 20 | + $v_username = escapeshellarg($user); |
| 21 | + $v_domain = escapeshellarg($_GET['domain']); |
| 22 | + exec (VESTA_CMD."v-suspend-mail-domain ".$v_username." ".$v_domain, $output, $return_var); |
| 23 | + check_return_code($return_var,$output); |
| 24 | + unset($output); |
| 25 | + $back=getenv("HTTP_REFERER"); |
| 26 | + if (!empty($back)) { |
| 27 | + header("Location: ".$back); |
26 | 28 | exit; |
27 | 29 | } |
| 30 | + header("Location: /list/mail/"); |
| 31 | + exit; |
| 32 | +} |
28 | 33 |
|
29 | | - // Mail account |
30 | | - if ((!empty($_GET['domain'])) && (!empty($_GET['account']))) { |
31 | | - $v_username = escapeshellarg($user); |
32 | | - $v_domain = escapeshellarg($_GET['domain']); |
33 | | - $v_account = escapeshellarg($_GET['account']); |
34 | | - exec (VESTA_CMD."v-suspend-mail-account ".$v_username." ".$v_domain." ".$v_account, $output, $return_var); |
35 | | - check_return_code($return_var,$output); |
36 | | - unset($output); |
37 | | - $back = $_SESSION['back']; |
38 | | - if (!empty($back)) { |
39 | | - header("Location: ".$back); |
40 | | - exit; |
41 | | - } |
42 | | - header("Location: /list/mail/?domain=".$_GET['domain']); |
| 34 | +// Mail account |
| 35 | +if ((!empty($_GET['domain'])) && (!empty($_GET['account']))) { |
| 36 | + $v_username = escapeshellarg($user); |
| 37 | + $v_domain = escapeshellarg($_GET['domain']); |
| 38 | + $v_account = escapeshellarg($_GET['account']); |
| 39 | + exec (VESTA_CMD."v-suspend-mail-account ".$v_username." ".$v_domain." ".$v_account, $output, $return_var); |
| 40 | + check_return_code($return_var,$output); |
| 41 | + unset($output); |
| 42 | + $back = $_SESSION['back']; |
| 43 | + if (!empty($back)) { |
| 44 | + header("Location: ".$back); |
43 | 45 | exit; |
44 | 46 | } |
| 47 | + header("Location: /list/mail/?domain=".$_GET['domain']); |
| 48 | + exit; |
45 | 49 | } |
46 | 50 |
|
47 | 51 | $back = $_SESSION['back']; |
48 | 52 | if (!empty($back)) { |
49 | 53 | header("Location: ".$back); |
50 | 54 | exit; |
51 | 55 | } |
| 56 | + |
52 | 57 | header("Location: /list/mail/"); |
53 | 58 | exit; |
0 commit comments