Skip to content

Commit dab033e

Browse files
committed
aligned code formating
1 parent baae928 commit dab033e

File tree

12 files changed

+275
-221
lines changed

12 files changed

+275
-221
lines changed

web/suspend/cron/index.php

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,21 @@
55
session_start();
66
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
77

8-
if ($_SESSION['user'] == 'admin') {
9-
if (!empty($_GET['user'])) {
10-
$user=$_GET['user'];
11-
}
12-
if (!empty($_GET['job'])) {
13-
$v_username = escapeshellarg($user);
14-
$v_job = escapeshellarg($_GET['job']);
15-
exec (VESTA_CMD."v-suspend-cron-job ".$v_username." ".$v_job, $output, $return_var);
16-
}
17-
check_return_code($return_var,$output);
18-
unset($output);
8+
// Check user
9+
if ($_SESSION['user'] != 'admin') {
10+
header("Location: /list/user");
11+
exit;
12+
}
13+
if (!empty($_GET['user'])) {
14+
$user=$_GET['user'];
15+
}
16+
if (!empty($_GET['job'])) {
17+
$v_username = escapeshellarg($user);
18+
$v_job = escapeshellarg($_GET['job']);
19+
exec (VESTA_CMD."v-suspend-cron-job ".$v_username." ".$v_job, $output, $return_var);
1920
}
21+
check_return_code($return_var,$output);
22+
unset($output);
2023

2124
$back = $_SESSION['back'];
2225
if (!empty($back)) {

web/suspend/db/index.php

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,23 @@
55
session_start();
66
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
77

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+
}
13+
14+
if (!empty($_GET['user'])) {
15+
$user=$_GET['user'];
16+
}
1217

13-
if (!empty($_GET['database'])) {
14-
$v_username = escapeshellarg($user);
15-
$v_database = escapeshellarg($_GET['database']);
16-
exec (VESTA_CMD."v-suspend-database ".$v_username." ".$v_database, $output, $return_var);
17-
}
18-
check_return_code($return_var,$output);
19-
unset($output);
18+
if (!empty($_GET['database'])) {
19+
$v_username = escapeshellarg($user);
20+
$v_database = escapeshellarg($_GET['database']);
21+
exec (VESTA_CMD."v-suspend-database ".$v_username." ".$v_database, $output, $return_var);
2022
}
23+
check_return_code($return_var,$output);
24+
unset($output);
2125

2226
$back = $_SESSION['back'];
2327
if (!empty($back)) {

web/suspend/dns/index.php

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,44 +5,49 @@
55
session_start();
66
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
77

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+
}
13+
14+
if (!empty($_GET['user'])) {
15+
$user=$_GET['user'];
16+
}
1217

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-suspend-dns-domain ".$v_username." ".$v_domain, $output, $return_var);
18-
check_return_code($return_var,$output);
19-
unset($output);
20-
$back = $_SESSION['back'];
21-
if (!empty($back)) {
22-
header("Location: ".$back);
23-
exit;
24-
}
25-
header("Location: /list/dns/");
18+
// DNS domain
19+
if ((!empty($_GET['domain'])) && (empty($_GET['record_id']))) {
20+
$v_username = escapeshellarg($user);
21+
$v_domain = escapeshellarg($_GET['domain']);
22+
exec (VESTA_CMD."v-suspend-dns-domain ".$v_username." ".$v_domain, $output, $return_var);
23+
check_return_code($return_var,$output);
24+
unset($output);
25+
$back = $_SESSION['back'];
26+
if (!empty($back)) {
27+
header("Location: ".$back);
2628
exit;
2729
}
30+
header("Location: /list/dns/");
31+
exit;
32+
}
2833

29-
// DNS record
30-
if ((!empty($_GET['domain'])) && (!empty($_GET['record_id']))) {
31-
$v_username = escapeshellarg($user);
32-
$v_domain = escapeshellarg($_GET['domain']);
33-
$v_record_id = escapeshellarg($_GET['record_id']);
34-
exec (VESTA_CMD."v-suspend-dns-record ".$v_username." ".$v_domain." ".$v_record_id, $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/dns/?domain=".$_GET['domain']);
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-suspend-dns-record ".$v_username." ".$v_domain." ".$v_record_id, $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);
4345
exit;
4446
}
47+
header("Location: /list/dns/?domain=".$_GET['domain']);
48+
exit;
4549
}
50+
4651
$back = $_SESSION['back'];
4752
if (!empty($back)) {
4853
header("Location: ".$back);

web/suspend/mail/index.php

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,49 +5,54 @@
55
session_start();
66
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
77

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+
}
1213

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);
2628
exit;
2729
}
30+
header("Location: /list/mail/");
31+
exit;
32+
}
2833

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);
4345
exit;
4446
}
47+
header("Location: /list/mail/?domain=".$_GET['domain']);
48+
exit;
4549
}
4650

4751
$back = $_SESSION['back'];
4852
if (!empty($back)) {
4953
header("Location: ".$back);
5054
exit;
5155
}
56+
5257
header("Location: /list/mail/");
5358
exit;

web/suspend/user/index.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@
55
$TAB = 'USER';
66
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
77

8-
// Are you admin?
9-
if ($_SESSION['user'] == 'admin') {
10-
if (!empty($_GET['user'])) {
11-
$v_username = escapeshellarg($_GET['user']);
12-
exec (VESTA_CMD."v-suspend-user ".$v_username, $output, $return_var);
13-
}
14-
check_return_code($return_var,$output);
15-
unset($output);
8+
// Check user
9+
if ($_SESSION['user'] != 'admin') {
10+
header("Location: /list/user");
11+
exit;
12+
}
13+
14+
if (!empty($_GET['user'])) {
15+
$v_username = escapeshellarg($_GET['user']);
16+
exec (VESTA_CMD."v-suspend-user ".$v_username, $output, $return_var);
1617
}
18+
check_return_code($return_var,$output);
19+
unset($output);
1720

1821
$back = $_SESSION['back'];
1922
if (!empty($back)) {

web/suspend/web/index.php

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,23 @@
55
session_start();
66
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
77

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+
}
13+
14+
if (!empty($_GET['user'])) {
15+
$user=$_GET['user'];
16+
}
1217

13-
if (!empty($_GET['domain'])) {
14-
$v_username = escapeshellarg($user);
15-
$v_domain = escapeshellarg($_GET['domain']);
16-
exec (VESTA_CMD."v-suspend-web-domain ".$v_username." ".$v_domain, $output, $return_var);
17-
}
18-
check_return_code($return_var,$output);
19-
unset($output);
18+
if (!empty($_GET['domain'])) {
19+
$v_username = escapeshellarg($user);
20+
$v_domain = escapeshellarg($_GET['domain']);
21+
exec (VESTA_CMD."v-suspend-web-domain ".$v_username." ".$v_domain, $output, $return_var);
2022
}
23+
check_return_code($return_var,$output);
24+
unset($output);
2125

2226
$back = $_SESSION['back'];
2327
if (!empty($back)) {

web/unsuspend/cron/index.php

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,32 @@
33
error_reporting(NULL);
44
ob_start();
55
session_start();
6+
67
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
78

8-
if ($_SESSION['user'] == 'admin') {
9-
if (!empty($_GET['user'])) {
10-
$user=$_GET['user'];
11-
}
12-
if (!empty($_GET['job'])) {
13-
$v_username = escapeshellarg($user);
14-
$v_job = escapeshellarg($_GET['job']);
15-
exec (VESTA_CMD."v-unsuspend-cron-job ".$v_username." ".$v_job, $output, $return_var);
16-
}
17-
check_return_code($return_var,$output);
18-
unset($output);
9+
// Check user
10+
if ($_SESSION['user'] != 'admin') {
11+
header("Location: /list/user");
12+
exit;
13+
}
14+
15+
if (!empty($_GET['user'])) {
16+
$user=$_GET['user'];
17+
}
1918

19+
if (!empty($_GET['job'])) {
20+
$v_username = escapeshellarg($user);
21+
$v_job = escapeshellarg($_GET['job']);
22+
exec (VESTA_CMD."v-unsuspend-cron-job ".$v_username." ".$v_job, $output, $return_var);
2023
}
24+
check_return_code($return_var,$output);
25+
unset($output);
2126

2227
$back=getenv("HTTP_REFERER");
2328
if (!empty($back)) {
2429
header("Location: ".$back);
2530
exit;
2631
}
32+
2733
header("Location: /list/cron/");
2834
exit;

web/unsuspend/db/index.php

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,28 @@
55
session_start();
66
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
77

8-
if ($_SESSION['user'] == 'admin') {
9-
if (!empty($_GET['user'])) {
10-
$user=$_GET['user'];
11-
}
12-
if (!empty($_GET['database'])) {
13-
$v_username = escapeshellarg($user);
14-
$v_database = escapeshellarg($_GET['database']);
15-
exec (VESTA_CMD."v-unsuspend-database ".$v_username." ".$v_database, $output, $return_var);
16-
check_return_code($return_var,$output);
17-
unset($output);
18-
}
8+
// Check user
9+
if ($_SESSION['user'] != 'admin') {
10+
header("Location: /list/user");
11+
exit;
12+
}
13+
14+
if (!empty($_GET['user'])) {
15+
$user=$_GET['user'];
16+
}
17+
if (!empty($_GET['database'])) {
18+
$v_username = escapeshellarg($user);
19+
$v_database = escapeshellarg($_GET['database']);
20+
exec (VESTA_CMD."v-unsuspend-database ".$v_username." ".$v_database, $output, $return_var);
21+
check_return_code($return_var,$output);
22+
unset($output);
1923
}
2024

2125
$back=getenv("HTTP_REFERER");
2226
if (!empty($back)) {
2327
header("Location: ".$back);
2428
exit;
2529
}
30+
2631
header("Location: /list/db/");
2732
exit;

0 commit comments

Comments
 (0)