diff --git a/func/main.sh b/func/main.sh index 23dc6c10..b0aa1f68 100755 --- a/func/main.sh +++ b/func/main.sh @@ -194,7 +194,7 @@ is_object_suspended() { spnd=$(grep "$2='$3'" $USER_DATA/$1.conf|grep "SUSPENDED='yes'") fi if [ -z "$spnd" ]; then - echo "Error: $3 is not suspended" + echo "Error: $1 $3 is not suspended" log_event "$E_SUSPENDED" "$EVENT" exit $E_SUSPENDED fi @@ -208,7 +208,7 @@ is_object_unsuspended() { spnd=$(grep "$2='$3'" $USER_DATA/$1.conf|grep "SUSPENDED='yes'") fi if [ ! -z "$spnd" ]; then - echo "Error: $3 is suspended" + echo "Error: $1 $3 is already suspended" log_event "$E_UNSUSPENDED" "$EVENT" exit $E_UNSUSPENDED fi diff --git a/web/delete/backup/index.php b/web/delete/backup/index.php index c8dd0c19..37b833c1 100644 --- a/web/delete/backup/index.php +++ b/web/delete/backup/index.php @@ -10,8 +10,14 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); $v_username = escapeshellarg($user); $v_backup = escapeshellarg($_GET['backup']); exec (VESTA_CMD."v_delete_user_backup ".$v_username." ".$v_backup, $output, $return_var); - unset($output); } + if ($return_var != 0) { + $error = implode('
', $output); + if (empty($error)) $error = 'Error: vesta did not return any output.'; + $_SESSION['error_msg'] = $error; + } + unset($output); + //} header("Location: /list/backup/"); diff --git a/web/delete/cron/index.php b/web/delete/cron/index.php index 99d3287c..6e6a2e8a 100644 --- a/web/delete/cron/index.php +++ b/web/delete/cron/index.php @@ -10,8 +10,14 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); $v_username = escapeshellarg($user); $v_job = escapeshellarg($_GET['job']); exec (VESTA_CMD."v_delete_cron_job ".$v_username." ".$v_job, $output, $return_var); - unset($output); } + if ($return_var != 0) { + $error = implode('
', $output); + if (empty($error)) $error = 'Error: vesta did not return any output.'; + $_SESSION['error_msg'] = $error; + } + unset($output); + //} header("Location: /list/cron/"); diff --git a/web/delete/db/index.php b/web/delete/db/index.php index 278eb2ec..c1ebc531 100644 --- a/web/delete/db/index.php +++ b/web/delete/db/index.php @@ -10,8 +10,14 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); $v_username = escapeshellarg($user); $v_database = escapeshellarg($_GET['database']); exec (VESTA_CMD."v_delete_database ".$v_username." ".$v_database, $output, $return_var); - unset($output); } + if ($return_var != 0) { + $error = implode('
', $output); + if (empty($error)) $error = 'Error: vesta did not return any output.'; + $_SESSION['error_msg'] = $error; + } + unset($output); + //} header("Location: /list/db/"); diff --git a/web/delete/dns/index.php b/web/delete/dns/index.php index ba78d0da..7b1449fc 100644 --- a/web/delete/dns/index.php +++ b/web/delete/dns/index.php @@ -11,6 +11,11 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); $v_username = escapeshellarg($user); $v_domain = escapeshellarg($_GET['domain']); exec (VESTA_CMD."v_delete_dns_domain ".$v_username." ".$v_domain, $output, $return_var); + if ($return_var != 0) { + $error = implode('
', $output); + if (empty($error)) $error = 'Error: vesta did not return any output.'; + $_SESSION['error_msg'] = $error; + } unset($output); header("Location: /list/dns/"); exit; @@ -22,6 +27,13 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); $v_domain = escapeshellarg($_GET['domain']); $v_record_id = escapeshellarg($_GET['record_id']); exec (VESTA_CMD."v_delete_dns_domain_record ".$v_username." ".$v_domain." ".$v_record_id, $output, $return_var); + if ($return_var != 0) { + $error = implode('
', $output); + if (empty($error)) $error = 'Error: vesta did not return any output.'; + $_SESSION['error_msg'] = $error; + } + unset($output); + unset($output); header("Location: /list/dns/?domain=".$_GET['domain']); exit; diff --git a/web/delete/ip/index.php b/web/delete/ip/index.php index c2115f04..46ab470e 100644 --- a/web/delete/ip/index.php +++ b/web/delete/ip/index.php @@ -9,8 +9,14 @@ if ($_SESSION['user'] == 'admin') { if (!empty($_GET['ip'])) { $v_ip = escapeshellarg($_GET['ip']); exec (VESTA_CMD."v_delete_sys_ip ".$v_ip, $output, $return_var); - unset($output); } + if ($return_var != 0) { + $error = implode('
', $output); + if (empty($error)) $error = 'Error: vesta did not return any output.'; + $_SESSION['error_msg'] = $error; + } + unset($output); + } header("Location: /list/ip/"); diff --git a/web/delete/mail/index.php b/web/delete/mail/index.php index 7092f68a..6ccd8120 100644 --- a/web/delete/mail/index.php +++ b/web/delete/mail/index.php @@ -11,6 +11,11 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); $v_username = escapeshellarg($user); $v_domain = escapeshellarg($_GET['domain']); exec (VESTA_CMD."v_delete_mail_domain ".$v_username." ".$v_domain, $output, $return_var); + if ($return_var != 0) { + $error = implode('
', $output); + if (empty($error)) $error = 'Error: vesta did not return any output.'; + $_SESSION['error_msg'] = $error; + } unset($output); header("Location: /list/mail/"); exit; @@ -22,6 +27,11 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); $v_domain = escapeshellarg($_GET['domain']); $v_account = escapeshellarg($_GET['account']); exec (VESTA_CMD."v_delete_mail_account ".$v_username." ".$v_domain." ".$v_account, $output, $return_var); + if ($return_var != 0) { + $error = implode('
', $output); + if (empty($error)) $error = 'Error: vesta did not return any output.'; + $_SESSION['error_msg'] = $error; + } unset($output); header("Location: /list/mail/?domain=".$_GET['domain']); exit; diff --git a/web/delete/package/index.php b/web/delete/package/index.php index 29232bd2..28d2d1ee 100644 --- a/web/delete/package/index.php +++ b/web/delete/package/index.php @@ -9,8 +9,13 @@ if ($_SESSION['user'] == 'admin') { if (!empty($_GET['package'])) { $v_package = escapeshellarg($_GET['package']); exec (VESTA_CMD."v_delete_user_package ".$v_package, $output, $return_var); - unset($output); } + if ($return_var != 0) { + $error = implode('
', $output); + if (empty($error)) $error = 'Error: vesta did not return any output.'; + $_SESSION['error_msg'] = $error; + } + unset($output); } header("Location: /list/package/"); diff --git a/web/delete/user/index.php b/web/delete/user/index.php index 9cf60b78..13a5ae24 100644 --- a/web/delete/user/index.php +++ b/web/delete/user/index.php @@ -9,8 +9,13 @@ if ($_SESSION['user'] == 'admin') { if (!empty($_GET['user'])) { $v_username = escapeshellarg($_GET['user']); exec (VESTA_CMD."v_delete_user ".$v_username, $output, $return_var); - unset($output); } + if ($return_var != 0) { + $error = implode('
', $output); + if (empty($error)) $error = 'Error: vesta did not return any output.'; + $_SESSION['error_msg'] = $error; + } + unset($output); } header("Location: /list/user/"); diff --git a/web/delete/web/index.php b/web/delete/web/index.php index 012725a6..33067162 100644 --- a/web/delete/web/index.php +++ b/web/delete/web/index.php @@ -9,6 +9,11 @@ if (!empty($_GET['domain'])) { $v_username = escapeshellarg($user); $v_domain = escapeshellarg($_GET['domain']); exec (VESTA_CMD."v_delete_web_domain ".$v_username." ".$v_domain, $output, $return_var); + if ($return_var != 0) { + $error = implode('
', $output); + if (empty($error)) $error = 'Error: vesta did not return any output.'; + $_SESSION['error_msg'] = $error; + } unset($output); // DNS @@ -16,6 +21,11 @@ if (!empty($_GET['domain'])) { exec (VESTA_CMD."v_list_dns_domain ".$v_username." ".$v_domain." json", $output, $lreturn_var); if ($lreturn_var == 0 ) { exec (VESTA_CMD."v_delete_dns_domain ".$v_username." ".$v_domain, $output, $return_var); + if ($return_var != 0) { + $error = implode('
', $output); + if (empty($error)) $error = 'Error: vesta did not return any output.'; + $_SESSION['error_msg'] = $error; + } unset($output); } } @@ -25,6 +35,12 @@ if (!empty($_GET['domain'])) { exec (VESTA_CMD."v_list_mail_domain ".$v_username." ".$v_domain." json", $output, $lreturn_var); if ($lreturn_var == 0 ) { exec (VESTA_CMD."v_delete_mail_domain ".$v_username." ".$v_domain, $output, $return_var); + if ($return_var != 0) { + $error = implode('
', $output); + if (empty($error)) $error = 'Error: vesta did not return any output.'; + $_SESSION['error_msg'] = $error; + } + unset($output); } } } diff --git a/web/suspend/cron/index.php b/web/suspend/cron/index.php index eeeb0a6e..538259a8 100644 --- a/web/suspend/cron/index.php +++ b/web/suspend/cron/index.php @@ -10,8 +10,13 @@ if ($_SESSION['user'] == 'admin') { $v_username = escapeshellarg($user); $v_job = escapeshellarg($_GET['job']); exec (VESTA_CMD."v_suspend_cron_job ".$v_username." ".$v_job, $output, $return_var); - unset($output); } + if ($return_var != 0) { + $error = implode('
', $output); + if (empty($error)) $error = 'Error: vesta did not return any output.'; + $_SESSION['error_msg'] = $error; + } + unset($output); } header("Location: /list/cron/"); diff --git a/web/suspend/db/index.php b/web/suspend/db/index.php index 9f725f80..035dbf71 100644 --- a/web/suspend/db/index.php +++ b/web/suspend/db/index.php @@ -10,8 +10,14 @@ if ($_SESSION['user'] == 'admin') { $v_username = escapeshellarg($user); $v_database = escapeshellarg($_GET['database']); exec (VESTA_CMD."v_suspend_database ".$v_username." ".$v_database, $output, $return_var); - unset($output); } + if ($return_var != 0) { + $error = implode('
', $output); + if (empty($error)) $error = 'Error: vesta did not return any output.'; + $_SESSION['error_msg'] = $error; + } + unset($output); + } header("Location: /list/db/"); diff --git a/web/suspend/dns/index.php b/web/suspend/dns/index.php index 1aa43538..68d51e0d 100644 --- a/web/suspend/dns/index.php +++ b/web/suspend/dns/index.php @@ -11,6 +11,11 @@ if ($_SESSION['user'] == 'admin') { $v_username = escapeshellarg($user); $v_domain = escapeshellarg($_GET['domain']); exec (VESTA_CMD."v_suspend_dns_domain ".$v_username." ".$v_domain, $output, $return_var); + if ($return_var != 0) { + $error = implode('
', $output); + if (empty($error)) $error = 'Error: vesta did not return any output.'; + $_SESSION['error_msg'] = $error; + } unset($output); header("Location: /list/dns/"); exit; @@ -22,6 +27,11 @@ if ($_SESSION['user'] == 'admin') { $v_domain = escapeshellarg($_GET['domain']); $v_record_id = escapeshellarg($_GET['record_id']); exec (VESTA_CMD."v_suspend_dns_domain_record ".$v_username." ".$v_domain." ".$v_record_id, $output, $return_var); + if ($return_var != 0) { + $error = implode('
', $output); + if (empty($error)) $error = 'Error: vesta did not return any output.'; + $_SESSION['error_msg'] = $error; + } unset($output); header("Location: /list/dns/?domain=".$_GET['domain']); exit; diff --git a/web/suspend/mail/index.php b/web/suspend/mail/index.php index 4f05263f..409d8063 100644 --- a/web/suspend/mail/index.php +++ b/web/suspend/mail/index.php @@ -11,6 +11,11 @@ if ($_SESSION['user'] == 'admin') { $v_username = escapeshellarg($user); $v_domain = escapeshellarg($_GET['domain']); exec (VESTA_CMD."v_suspend_mail_domain ".$v_username." ".$v_domain, $output, $return_var); + if ($return_var != 0) { + $error = implode('
', $output); + if (empty($error)) $error = 'Error: vesta did not return any output.'; + $_SESSION['error_msg'] = $error; + } unset($output); header("Location: /list/mail/"); exit; @@ -22,6 +27,11 @@ if ($_SESSION['user'] == 'admin') { $v_domain = escapeshellarg($_GET['domain']); $v_account = escapeshellarg($_GET['account']); exec (VESTA_CMD."v_suspend_mail_account ".$v_username." ".$v_domain." ".$v_account, $output, $return_var); + if ($return_var != 0) { + $error = implode('
', $output); + if (empty($error)) $error = 'Error: vesta did not return any output.'; + $_SESSION['error_msg'] = $error; + } unset($output); header("Location: /list/mail/?domain=".$_GET['domain']); exit; diff --git a/web/suspend/user/index.php b/web/suspend/user/index.php index 75dc0659..360f1f99 100644 --- a/web/suspend/user/index.php +++ b/web/suspend/user/index.php @@ -10,8 +10,14 @@ if ($_SESSION['user'] == 'admin') { if (!empty($_GET['user'])) { $v_username = escapeshellarg($_GET['user']); exec (VESTA_CMD."v_suspend_user ".$v_username, $output, $return_var); - unset($output); } + if ($return_var != 0) { + $error = implode('
', $output); + if (empty($error)) $error = 'Error: vesta did not return any output.'; + $_SESSION['error_msg'] = $error; + } + unset($output); + } header("Location: /list/user/"); diff --git a/web/suspend/web/index.php b/web/suspend/web/index.php index 2cc737ec..d37409fe 100644 --- a/web/suspend/web/index.php +++ b/web/suspend/web/index.php @@ -10,8 +10,13 @@ if ($_SESSION['user'] == 'admin') { $v_username = escapeshellarg($user); $v_domain = escapeshellarg($_GET['domain']); exec (VESTA_CMD."v_suspend_web_domain ".$v_username." ".$v_domain, $output, $return_var); - unset($output); } + if ($return_var != 0) { + $error = implode('
', $output); + if (empty($error)) $error = 'Error: vesta did not return any output.'; + $_SESSION['error_msg'] = $error; + } + unset($output); } header("Location: /list/web/"); diff --git a/web/templates/admin/list_web.html b/web/templates/admin/list_web.html index fbf3e293..7de37ec4 100644 --- a/web/templates/admin/list_web.html +++ b/web/templates/admin/list_web.html @@ -76,7 +76,7 @@ foreach ($data as $key => $value) { - + diff --git a/web/templates/admin/menu_backup.html b/web/templates/admin/menu_backup.html index 987d197d..86ce7a27 100644 --- a/web/templates/admin/menu_backup.html +++ b/web/templates/admin/menu_backup.html @@ -1,3 +1,26 @@ + + +
+

.

+
+
" >
">