Skip to content

Commit 3f5617c

Browse files
committed
added error message dialog
1 parent 25a2926 commit 3f5617c

36 files changed

+494
-18
lines changed

func/main.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ is_object_suspended() {
194194
spnd=$(grep "$2='$3'" $USER_DATA/$1.conf|grep "SUSPENDED='yes'")
195195
fi
196196
if [ -z "$spnd" ]; then
197-
echo "Error: $3 is not suspended"
197+
echo "Error: $1 $3 is not suspended"
198198
log_event "$E_SUSPENDED" "$EVENT"
199199
exit $E_SUSPENDED
200200
fi
@@ -208,7 +208,7 @@ is_object_unsuspended() {
208208
spnd=$(grep "$2='$3'" $USER_DATA/$1.conf|grep "SUSPENDED='yes'")
209209
fi
210210
if [ ! -z "$spnd" ]; then
211-
echo "Error: $3 is suspended"
211+
echo "Error: $1 $3 is already suspended"
212212
log_event "$E_UNSUSPENDED" "$EVENT"
213213
exit $E_UNSUSPENDED
214214
fi

web/delete/backup/index.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@
1010
$v_username = escapeshellarg($user);
1111
$v_backup = escapeshellarg($_GET['backup']);
1212
exec (VESTA_CMD."v_delete_user_backup ".$v_username." ".$v_backup, $output, $return_var);
13-
unset($output);
1413
}
14+
if ($return_var != 0) {
15+
$error = implode('<br>', $output);
16+
if (empty($error)) $error = 'Error: vesta did not return any output.';
17+
$_SESSION['error_msg'] = $error;
18+
}
19+
unset($output);
20+
1521
//}
1622

1723
header("Location: /list/backup/");

web/delete/cron/index.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@
1010
$v_username = escapeshellarg($user);
1111
$v_job = escapeshellarg($_GET['job']);
1212
exec (VESTA_CMD."v_delete_cron_job ".$v_username." ".$v_job, $output, $return_var);
13-
unset($output);
1413
}
14+
if ($return_var != 0) {
15+
$error = implode('<br>', $output);
16+
if (empty($error)) $error = 'Error: vesta did not return any output.';
17+
$_SESSION['error_msg'] = $error;
18+
}
19+
unset($output);
20+
1521
//}
1622

1723
header("Location: /list/cron/");

web/delete/db/index.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@
1010
$v_username = escapeshellarg($user);
1111
$v_database = escapeshellarg($_GET['database']);
1212
exec (VESTA_CMD."v_delete_database ".$v_username." ".$v_database, $output, $return_var);
13-
unset($output);
1413
}
14+
if ($return_var != 0) {
15+
$error = implode('<br>', $output);
16+
if (empty($error)) $error = 'Error: vesta did not return any output.';
17+
$_SESSION['error_msg'] = $error;
18+
}
19+
unset($output);
20+
1521
//}
1622

1723
header("Location: /list/db/");

web/delete/dns/index.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
$v_username = escapeshellarg($user);
1212
$v_domain = escapeshellarg($_GET['domain']);
1313
exec (VESTA_CMD."v_delete_dns_domain ".$v_username." ".$v_domain, $output, $return_var);
14+
if ($return_var != 0) {
15+
$error = implode('<br>', $output);
16+
if (empty($error)) $error = 'Error: vesta did not return any output.';
17+
$_SESSION['error_msg'] = $error;
18+
}
1419
unset($output);
1520
header("Location: /list/dns/");
1621
exit;
@@ -22,6 +27,13 @@
2227
$v_domain = escapeshellarg($_GET['domain']);
2328
$v_record_id = escapeshellarg($_GET['record_id']);
2429
exec (VESTA_CMD."v_delete_dns_domain_record ".$v_username." ".$v_domain." ".$v_record_id, $output, $return_var);
30+
if ($return_var != 0) {
31+
$error = implode('<br>', $output);
32+
if (empty($error)) $error = 'Error: vesta did not return any output.';
33+
$_SESSION['error_msg'] = $error;
34+
}
35+
unset($output);
36+
2537
unset($output);
2638
header("Location: /list/dns/?domain=".$_GET['domain']);
2739
exit;

web/delete/ip/index.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@
99
if (!empty($_GET['ip'])) {
1010
$v_ip = escapeshellarg($_GET['ip']);
1111
exec (VESTA_CMD."v_delete_sys_ip ".$v_ip, $output, $return_var);
12-
unset($output);
1312
}
13+
if ($return_var != 0) {
14+
$error = implode('<br>', $output);
15+
if (empty($error)) $error = 'Error: vesta did not return any output.';
16+
$_SESSION['error_msg'] = $error;
17+
}
18+
unset($output);
19+
1420
}
1521

1622
header("Location: /list/ip/");

web/delete/mail/index.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
$v_username = escapeshellarg($user);
1212
$v_domain = escapeshellarg($_GET['domain']);
1313
exec (VESTA_CMD."v_delete_mail_domain ".$v_username." ".$v_domain, $output, $return_var);
14+
if ($return_var != 0) {
15+
$error = implode('<br>', $output);
16+
if (empty($error)) $error = 'Error: vesta did not return any output.';
17+
$_SESSION['error_msg'] = $error;
18+
}
1419
unset($output);
1520
header("Location: /list/mail/");
1621
exit;
@@ -22,6 +27,11 @@
2227
$v_domain = escapeshellarg($_GET['domain']);
2328
$v_account = escapeshellarg($_GET['account']);
2429
exec (VESTA_CMD."v_delete_mail_account ".$v_username." ".$v_domain." ".$v_account, $output, $return_var);
30+
if ($return_var != 0) {
31+
$error = implode('<br>', $output);
32+
if (empty($error)) $error = 'Error: vesta did not return any output.';
33+
$_SESSION['error_msg'] = $error;
34+
}
2535
unset($output);
2636
header("Location: /list/mail/?domain=".$_GET['domain']);
2737
exit;

web/delete/package/index.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@
99
if (!empty($_GET['package'])) {
1010
$v_package = escapeshellarg($_GET['package']);
1111
exec (VESTA_CMD."v_delete_user_package ".$v_package, $output, $return_var);
12-
unset($output);
1312
}
13+
if ($return_var != 0) {
14+
$error = implode('<br>', $output);
15+
if (empty($error)) $error = 'Error: vesta did not return any output.';
16+
$_SESSION['error_msg'] = $error;
17+
}
18+
unset($output);
1419
}
1520

1621
header("Location: /list/package/");

web/delete/user/index.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@
99
if (!empty($_GET['user'])) {
1010
$v_username = escapeshellarg($_GET['user']);
1111
exec (VESTA_CMD."v_delete_user ".$v_username, $output, $return_var);
12-
unset($output);
1312
}
13+
if ($return_var != 0) {
14+
$error = implode('<br>', $output);
15+
if (empty($error)) $error = 'Error: vesta did not return any output.';
16+
$_SESSION['error_msg'] = $error;
17+
}
18+
unset($output);
1419
}
1520

1621
header("Location: /list/user/");

web/delete/web/index.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,23 @@
99
$v_username = escapeshellarg($user);
1010
$v_domain = escapeshellarg($_GET['domain']);
1111
exec (VESTA_CMD."v_delete_web_domain ".$v_username." ".$v_domain, $output, $return_var);
12+
if ($return_var != 0) {
13+
$error = implode('<br>', $output);
14+
if (empty($error)) $error = 'Error: vesta did not return any output.';
15+
$_SESSION['error_msg'] = $error;
16+
}
1217
unset($output);
1318

1419
// DNS
1520
if ($return_var == 0) {
1621
exec (VESTA_CMD."v_list_dns_domain ".$v_username." ".$v_domain." json", $output, $lreturn_var);
1722
if ($lreturn_var == 0 ) {
1823
exec (VESTA_CMD."v_delete_dns_domain ".$v_username." ".$v_domain, $output, $return_var);
24+
if ($return_var != 0) {
25+
$error = implode('<br>', $output);
26+
if (empty($error)) $error = 'Error: vesta did not return any output.';
27+
$_SESSION['error_msg'] = $error;
28+
}
1929
unset($output);
2030
}
2131
}
@@ -25,6 +35,12 @@
2535
exec (VESTA_CMD."v_list_mail_domain ".$v_username." ".$v_domain." json", $output, $lreturn_var);
2636
if ($lreturn_var == 0 ) {
2737
exec (VESTA_CMD."v_delete_mail_domain ".$v_username." ".$v_domain, $output, $return_var);
38+
if ($return_var != 0) {
39+
$error = implode('<br>', $output);
40+
if (empty($error)) $error = 'Error: vesta did not return any output.';
41+
$_SESSION['error_msg'] = $error;
42+
}
43+
unset($output);
2844
}
2945
}
3046
}

0 commit comments

Comments
 (0)