mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-14 18:49:17 -07:00
check_return_code function
This commit is contained in:
parent
8f9c7272b9
commit
80d5dd9ab0
16 changed files with 298 additions and 725 deletions
|
@ -26,11 +26,8 @@ if (empty($_GET['job'])) {
|
|||
|
||||
$v_job = escapeshellarg($_GET['job']);
|
||||
exec (VESTA_CMD."v-list-cron-job ".$user." ".$v_job." 'json'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
} else {
|
||||
check_return_code($return_var,$output);
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
$data = json_decode(implode('', $output), true);
|
||||
unset($output);
|
||||
$v_username = $user;
|
||||
|
@ -62,11 +59,7 @@ if ($return_var != 0) {
|
|||
$v_wday = escapeshellarg($_POST['v_wday']);
|
||||
$v_cmd = escapeshellarg($_POST['v_cmd']);
|
||||
exec (VESTA_CMD."v-change-cron-job ".$v_username." ".$v_job." ".$v_min." ".$v_hour." ".$v_day." ".$v_month." ".$v_wday." ".$v_cmd, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
$v_cmd = $_POST['v_cmd'];
|
||||
}
|
||||
|
|
|
@ -25,11 +25,8 @@ if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) {
|
|||
|
||||
$v_database = escapeshellarg($_GET['database']);
|
||||
exec (VESTA_CMD."v-list-database ".$user." ".$v_database." 'json'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
} else {
|
||||
check_return_code($return_var,$output);
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
$data = json_decode(implode('', $output), true);
|
||||
unset($output);
|
||||
$v_username = $user;
|
||||
|
|
|
@ -28,14 +28,10 @@ if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) {
|
|||
if ((!empty($_GET['domain'])) && (empty($_GET['record_id']))) {
|
||||
$v_domain = escapeshellarg($_GET['domain']);
|
||||
exec (VESTA_CMD."v-list-dns-domain ".$user." ".$v_domain." json", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
} else {
|
||||
check_return_code($return_var,$output);
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
$data = json_decode(implode('', $output), true);
|
||||
unset($output);
|
||||
|
||||
$v_username = $user;
|
||||
$v_domain = $_GET['domain'];
|
||||
$v_ip = $data[$v_domain]['IP'];
|
||||
|
@ -51,7 +47,6 @@ if ((!empty($_GET['domain'])) && (empty($_GET['record_id']))) {
|
|||
} else {
|
||||
$v_status = 'active';
|
||||
}
|
||||
|
||||
exec (VESTA_CMD."v-list-dns-templates json", $output, $return_var);
|
||||
$templates = json_decode(implode('', $output), true);
|
||||
unset($output);
|
||||
|
@ -65,11 +60,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['record_id']))) {
|
|||
if (($v_ip != $_POST['v_ip']) && (empty($_SESSION['error_msg']))) {
|
||||
$v_ip = escapeshellarg($_POST['v_ip']);
|
||||
exec (VESTA_CMD."v-change-dns-domain-ip ".$v_username." ".$v_domain." ".$v_ip." 'no'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
$restart_dns = 'yes';
|
||||
unset($output);
|
||||
}
|
||||
|
@ -78,11 +69,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['record_id']))) {
|
|||
if (( $_SESSION['user'] == 'admin') && ($v_template != $_POST['v_template']) && (empty($_SESSION['error_msg']))) {
|
||||
$v_template = escapeshellarg($_POST['v_template']);
|
||||
exec (VESTA_CMD."v-change-dns-domain-tpl ".$v_username." ".$v_domain." ".$v_template." 'no'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
$restart_dns = 'yes';
|
||||
}
|
||||
|
@ -91,11 +78,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['record_id']))) {
|
|||
if (($v_soa != $_POST['v_soa']) && (empty($_SESSION['error_msg']))) {
|
||||
$v_soa = escapeshellarg($_POST['v_soa']);
|
||||
exec (VESTA_CMD."v-change-dns-domain-soa ".$v_username." ".$v_domain." ".$v_soa." 'no'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
$restart_dns = 'yes';
|
||||
}
|
||||
|
@ -104,11 +87,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['record_id']))) {
|
|||
if (($v_exp != $_POST['v_exp']) && (empty($_SESSION['error_msg']))) {
|
||||
$v_exp = escapeshellarg($_POST['v_exp']);
|
||||
exec (VESTA_CMD."v-change-dns-domain-exp ".$v_username." ".$v_domain." ".$v_exp." 'no'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
$restart_dns = 'yes';
|
||||
}
|
||||
|
@ -117,11 +96,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['record_id']))) {
|
|||
if (($v_ttl != $_POST['v_ttl']) && (empty($_SESSION['error_msg']))) {
|
||||
$v_ttl = escapeshellarg($_POST['v_ttl']);
|
||||
exec (VESTA_CMD."v-change-dns-domain-ttl ".$v_username." ".$v_domain." ".$v_ttl." 'no'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
$restart_dns = 'yes';
|
||||
}
|
||||
|
@ -129,17 +104,13 @@ if ((!empty($_GET['domain'])) && (empty($_GET['record_id']))) {
|
|||
// Restart dns
|
||||
if (!empty($restart_dns) && (empty($_SESSION['error_msg']))) {
|
||||
exec (VESTA_CMD."v-restart-dns", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
}
|
||||
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
$_SESSION['ok_msg'] = __('Changes has been saved.');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($_SESSION['user'] == 'admin') {
|
||||
|
@ -153,11 +124,8 @@ if ((!empty($_GET['domain'])) && (empty($_GET['record_id']))) {
|
|||
$v_domain = escapeshellarg($_GET['domain']);
|
||||
$v_record_id = escapeshellarg($_GET['record_id']);
|
||||
exec (VESTA_CMD."v-list-dns-records ".$user." ".$v_domain." 'json'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
} else {
|
||||
check_return_code($return_var,$output);
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
$data = json_decode(implode('', $output), true);
|
||||
unset($output);
|
||||
$v_username = $user;
|
||||
|
@ -185,12 +153,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['record_id']))) {
|
|||
$v_val = escapeshellarg($_POST['v_val']);
|
||||
$v_priority = escapeshellarg($_POST['v_priority']);
|
||||
exec (VESTA_CMD."v-change-dns-record ".$v_username." ".$v_domain." ".$v_record_id." ".$v_val." ".$v_priority, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
|
||||
check_return_code($return_var,$output);
|
||||
$v_val = $_POST['v_val'];
|
||||
$restart_dns = 'yes';
|
||||
unset($output);
|
||||
|
@ -199,15 +162,10 @@ if ((!empty($_GET['domain'])) && (empty($_GET['record_id']))) {
|
|||
if (($_GET['record_id'] != $_POST['v_record_id']) && (empty($_SESSION['error_msg']))) {
|
||||
$v_old_record_id = escapeshellarg($_GET['record_id']);
|
||||
exec (VESTA_CMD."v-change-dns-record-id ".$v_username." ".$v_domain." ".$v_old_record_id." ".$v_record_id, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
}
|
||||
|
||||
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
$_SESSION['ok_msg'] = __('Changes has been saved.');
|
||||
}
|
||||
|
|
|
@ -24,11 +24,8 @@ if ($_SESSION['user'] == 'admin') {
|
|||
|
||||
$v_ip = escapeshellarg($_GET['ip']);
|
||||
exec (VESTA_CMD."v-list-sys-ip ".$v_ip." 'json'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
} else {
|
||||
check_return_code($return_var,$output);
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
$data = json_decode(implode('', $output), true);
|
||||
unset($output);
|
||||
$v_username = $user;
|
||||
|
@ -61,21 +58,13 @@ if ($_SESSION['user'] == 'admin') {
|
|||
// Change Status
|
||||
if (($v_ipstatus == 'shared') && (empty($_POST['v_shared'])) && (empty($_SESSION['error_msg']))) {
|
||||
exec (VESTA_CMD."v-change-sys-ip-status ".$v_ip." 'dedicated'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
$v_dedicated = 'yes';
|
||||
}
|
||||
if (($v_ipstatus == 'dedicated') && (!empty($_POST['v_shared'])) && (empty($_SESSION['error_msg']))) {
|
||||
exec (VESTA_CMD."v-change-sys-ip-status ".$v_ip." 'shared'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
unset($v_dedicated);
|
||||
}
|
||||
|
@ -84,11 +73,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
if (($v_owner != $_POST['v_owner']) && (empty($_SESSION['error_msg']))) {
|
||||
$v_owner = escapeshellarg($_POST['v_owner']);
|
||||
exec (VESTA_CMD."v-change-sys-ip-owner ".$v_ip." ".$v_owner, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
$v_owner = $_POST['v_owner'];
|
||||
unset($output);
|
||||
}
|
||||
|
@ -97,11 +82,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
if (($v_name != $_POST['v_name']) && (empty($_SESSION['error_msg']))) {
|
||||
$v_name = escapeshellarg($_POST['v_name']);
|
||||
exec (VESTA_CMD."v-change-sys-ip-name ".$v_ip." ".$v_name, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
}
|
||||
|
||||
|
@ -109,11 +90,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
if (($v_nat != $_POST['v_nat']) && (empty($_SESSION['error_msg']))) {
|
||||
$v_nat = escapeshellarg($_POST['v_nat']);
|
||||
exec (VESTA_CMD."v-change-sys-ip-nat ".$v_ip." ".$v_nat, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,11 +28,8 @@ if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) {
|
|||
if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
|
||||
$v_domain = escapeshellarg($_GET['domain']);
|
||||
exec (VESTA_CMD."v-list-mail-domain ".$user." ".$v_domain." json", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
} else {
|
||||
check_return_code($return_var,$output);
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
$data = json_decode(implode('', $output), true);
|
||||
unset($output);
|
||||
$v_username = $user;
|
||||
|
@ -57,42 +54,26 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
|
|||
// Antispam
|
||||
if (($v_antispam == 'yes') && (empty($_POST['v_antispam'])) && (empty($_SESSION['error_msg']))) {
|
||||
exec (VESTA_CMD."v-delete-mail-domain-antispam ".$v_username." ".$v_domain, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
$v_antispam = 'no';
|
||||
unset($output);
|
||||
}
|
||||
if (($v_antispam == 'no') && (!empty($_POST['v_antispam'])) && (empty($_SESSION['error_msg']))) {
|
||||
exec (VESTA_CMD."v-add-mail-domain-antispam ".$v_username." ".$v_domain, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
$v_antispam = 'yes';
|
||||
unset($output);
|
||||
}
|
||||
// Antivirus
|
||||
if (($v_antivirus == 'yes') && (empty($_POST['v_antivirus'])) && (empty($_SESSION['error_msg']))) {
|
||||
exec (VESTA_CMD."v-delete-mail-domain-antivirus ".$v_username." ".$v_domain, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
$v_antivirus = 'no';
|
||||
unset($output);
|
||||
}
|
||||
if (($v_antivirus == 'no') && (!empty($_POST['v_antivirus'])) && (empty($_SESSION['error_msg']))) {
|
||||
exec (VESTA_CMD."v-add-mail-domain-antivirus ".$v_username." ".$v_domain, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
$v_antivirus = 'yes';
|
||||
unset($output);
|
||||
}
|
||||
|
@ -103,21 +84,13 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
|
|||
// DKIM
|
||||
if (($v_dkim == 'yes') && (empty($_POST['v_dkim'])) && (empty($_SESSION['error_msg']))) {
|
||||
exec (VESTA_CMD."v-delete-mail-domain-dkim ".$v_username." ".$v_domain, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
$v_dkim = 'no';
|
||||
unset($output);
|
||||
}
|
||||
if (($v_dkim == 'no') && (!empty($_POST['v_dkim'])) && (empty($_SESSION['error_msg']))) {
|
||||
exec (VESTA_CMD."v-add-mail-domain-dkim ".$v_username." ".$v_domain, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
$v_dkim = 'yes';
|
||||
unset($output);
|
||||
}
|
||||
|
@ -125,11 +98,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
|
|||
// Catchall
|
||||
if ((!empty($v_catchall)) && (empty($_POST['v_catchall'])) && (empty($_SESSION['error_msg']))) {
|
||||
exec (VESTA_CMD."v-delete-mail-domain-catchall ".$v_username." ".$v_domain, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
$v_catchall = '';
|
||||
unset($output);
|
||||
}
|
||||
|
@ -137,22 +106,14 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
|
|||
if ($v_catchall != $_POST['v_catchall']) {
|
||||
$v_catchall = escapeshellarg($_POST['v_catchall']);
|
||||
exec (VESTA_CMD."v-change-mail-domain-catchall ".$v_username." ".$v_domain." ".$v_catchall, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
}
|
||||
}
|
||||
if ((empty($v_catchall)) && (!empty($_POST['v_catchall'])) && (empty($_SESSION['error_msg']))) {
|
||||
$v_catchall = escapeshellarg($_POST['v_catchall']);
|
||||
exec (VESTA_CMD."v-add-mail-domain-catchall ".$v_username." ".$v_domain." ".$v_catchall, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
}
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
|
@ -167,11 +128,8 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
|
|||
$v_domain = escapeshellarg($_GET['domain']);
|
||||
$v_account = escapeshellarg($_GET['account']);
|
||||
exec (VESTA_CMD."v-list-mail-account ".$user." ".$v_domain." ".$v_account." 'json'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
} else {
|
||||
check_return_code($return_var,$output);
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
$data = json_decode(implode('', $output), true);
|
||||
unset($output);
|
||||
$v_username = $user;
|
||||
|
@ -208,11 +166,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
|
|||
if (($v_password != $_POST['v_password']) && (empty($_SESSION['error_msg']))) {
|
||||
$v_password = escapeshellarg($_POST['v_password']);
|
||||
exec (VESTA_CMD."v-change-mail-account-password ".$v_username." ".$v_domain." ".$v_account." ".$v_password, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
$v_password = "••••••••";
|
||||
unset($output);
|
||||
}
|
||||
|
@ -225,11 +179,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
|
|||
$v_quota = escapeshellarg($_POST['v_quota']);
|
||||
}
|
||||
exec (VESTA_CMD."v-change-mail-account-quota ".$v_username." ".$v_domain." ".$v_account." ".$v_quota, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
}
|
||||
|
||||
|
@ -245,11 +195,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
|
|||
foreach ($result as $alias) {
|
||||
if ((empty($_SESSION['error_msg'])) && (!empty($alias))) {
|
||||
exec (VESTA_CMD."v-delete-mail-account-alias ".$v_username." ".$v_domain." ".$v_account." '".$alias."'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
}
|
||||
}
|
||||
|
@ -257,11 +203,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
|
|||
foreach ($result as $alias) {
|
||||
if ((empty($_SESSION['error_msg'])) && (!empty($alias))) {
|
||||
exec (VESTA_CMD."v-add-mail-account-alias ".$v_username." ".$v_domain." ".$v_account." '".$alias."'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
}
|
||||
}
|
||||
|
@ -278,11 +220,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
|
|||
foreach ($result as $forward) {
|
||||
if ((empty($_SESSION['error_msg'])) && (!empty($forward))) {
|
||||
exec (VESTA_CMD."v-delete-mail-account-forward ".$v_username." ".$v_domain." ".$v_account." '".$forward."'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
}
|
||||
}
|
||||
|
@ -290,11 +228,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
|
|||
foreach ($result as $forward) {
|
||||
if ((empty($_SESSION['error_msg'])) && (!empty($forward))) {
|
||||
exec (VESTA_CMD."v-add-mail-account-forward ".$v_username." ".$v_domain." ".$v_account." '".$forward."'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
}
|
||||
}
|
||||
|
@ -303,11 +237,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
|
|||
// Autoreply
|
||||
if (($v_autoreply == 'yes') && (empty($_POST['v_autoreply'])) && (empty($_SESSION['error_msg']))) {
|
||||
exec (VESTA_CMD."v-delete-mail-account-autoreply ".$v_username." ".$v_domain." ".$v_account, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
$v_autoreply = 'no';
|
||||
$v_autoreply_message = '';
|
||||
|
@ -317,26 +247,18 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
|
|||
$v_autoreply_message = str_replace("\r\n", "\n", $_POST['v_autoreply_message']);
|
||||
$v_autoreply_message = escapeshellarg($v_autoreply_message);
|
||||
exec (VESTA_CMD."v-add-mail-account-autoreply ".$v_username." ".$v_domain." ".$v_account." ".$v_autoreply_message, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
$v_autoreply_message = $_POST['v_autoreply_message'];
|
||||
}
|
||||
}
|
||||
if (($v_autoreply == 'no') && (!empty($_POST['v_autoreply'])) && (empty($_SESSION['error_msg']))) {
|
||||
if (($v_autoreply == 'no') && (!empty($_POST['v_autoreply'])) && (empty($_SESSION['error_msg']))) {
|
||||
if (empty($_POST['v_autoreply_message'])) $_SESSION['error_msg'] = $_SESSION['error_msg'] = __('Field "%s" can not be blank.','atoreply');
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
$v_autoreply_message = str_replace("\r\n", "\n", $_POST['v_autoreply_message']);
|
||||
$v_autoreply_message = escapeshellarg($v_autoreply_message);
|
||||
exec (VESTA_CMD."v-add-mail-account-autoreply ".$v_username." ".$v_domain." ".$v_account." ".$v_autoreply_message, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
$v_autoreply = 'yes';
|
||||
$v_autoreply_message = $_POST['v_autoreply_message'];
|
||||
|
|
|
@ -24,11 +24,8 @@ if ($_SESSION['user'] == 'admin') {
|
|||
|
||||
$v_package = escapeshellarg($_GET['package']);
|
||||
exec (VESTA_CMD."v-list-user-package ".$v_package." 'json'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
} else {
|
||||
check_return_code($return_var,$output);
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
$data = json_decode(implode('', $output), true);
|
||||
unset($output);
|
||||
|
||||
|
@ -172,11 +169,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
// Rewrite package
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
exec (VESTA_CMD."v-add-user-package ".$tmpdir." ".$v_package." 'yes'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
}
|
||||
|
||||
|
@ -186,11 +179,8 @@ if ($_SESSION['user'] == 'admin') {
|
|||
|
||||
// Propogate new package
|
||||
exec (VESTA_CMD."v-update-user-package ".$v_package." 'json'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
$_SESSION['ok_msg'] = __('Changes has been saved.');
|
||||
|
|
|
@ -22,11 +22,8 @@ if ($_SESSION['user'] == 'admin') {
|
|||
// Check user
|
||||
$v_username = escapeshellarg($_GET['user']);
|
||||
exec (VESTA_CMD."v-list-user ".$v_username." json", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
} else {
|
||||
check_return_code($return_var,$output);
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
$data = json_decode(implode('', $output), true);
|
||||
unset($output);
|
||||
$v_username = $_GET['user'];
|
||||
|
@ -73,11 +70,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
if (($v_password != $_POST['v_password']) && (empty($_SESSION['error_msg']))) {
|
||||
$v_password = escapeshellarg($_POST['v_password']);
|
||||
exec (VESTA_CMD."v-change-user-password ".$v_username." ".$v_password, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
$v_password = "••••••••";
|
||||
unset($output);
|
||||
}
|
||||
|
@ -86,11 +79,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
if (($v_package != $_POST['v_package']) && (empty($_SESSION['error_msg']))) {
|
||||
$v_package = escapeshellarg($_POST['v_package']);
|
||||
exec (VESTA_CMD."v-change-user-package ".$v_username." ".$v_package, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
}
|
||||
|
||||
|
@ -98,13 +87,8 @@ if ($_SESSION['user'] == 'admin') {
|
|||
if (($v_language != $_POST['v_language']) && (empty($_SESSION['error_msg']))) {
|
||||
$v_language = escapeshellarg($_POST['v_language']);
|
||||
exec (VESTA_CMD."v-change-user-language ".$v_username." ".$v_language, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
} else {
|
||||
if ($_GET['user'] == 'admin') $_SESSION['language'] = $_POST['v_language'];
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
if (($_GET['user'] == 'admin') && (empty($_SESSION['error_msg']))) $_SESSION['language'] = $_POST['v_language'];
|
||||
unset($output);
|
||||
}
|
||||
|
||||
|
@ -112,11 +96,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
if (($v_shell != $_POST['v_shell']) && (empty($_SESSION['error_msg']))) {
|
||||
$v_shell = escapeshellarg($_POST['v_shell']);
|
||||
exec (VESTA_CMD."v-change-user-shell ".$v_username." ".$v_shell, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
}
|
||||
|
||||
|
@ -128,11 +108,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
} else {
|
||||
$v_email = escapeshellarg($_POST['v_email']);
|
||||
exec (VESTA_CMD."v-change-user-contact ".$v_username." ".$v_email, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
}
|
||||
unset($output);
|
||||
}
|
||||
|
@ -142,11 +118,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
$v_fname = escapeshellarg($_POST['v_fname']);
|
||||
$v_lname = escapeshellarg($_POST['v_lname']);
|
||||
exec (VESTA_CMD."v-change-user-name ".$v_username." ".$v_fname." ".$v_lname, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
}
|
||||
|
||||
|
@ -160,11 +132,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
if (!empty($_POST['v_ns3'])) $ns_cmd = $ns_cmd." ".$v_ns3;
|
||||
if (!empty($_POST['v_ns4'])) $ns_cmd = $ns_cmd." ".$v_ns4;
|
||||
exec ($ns_cmd, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
}
|
||||
|
||||
|
@ -188,11 +156,8 @@ if ($_SESSION['user'] == 'admin') {
|
|||
// Check user
|
||||
$v_username = escapeshellarg($_GET['user']);
|
||||
exec (VESTA_CMD."v-list-user ".$v_username." json", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
} else {
|
||||
check_return_code($return_var,$output);
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
$data = json_decode(implode('', $output), true);
|
||||
unset($output);
|
||||
$v_username = $_GET['user'];
|
||||
|
@ -230,11 +195,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
if (($v_password != $_POST['v_password']) && (empty($_SESSION['error_msg']))) {
|
||||
$v_password = escapeshellarg($_POST['v_password']);
|
||||
exec (VESTA_CMD."v-change-user-password ".$v_username." ".$v_password, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
$v_password = "••••••••";
|
||||
unset($output);
|
||||
}
|
||||
|
@ -243,13 +204,8 @@ if ($_SESSION['user'] == 'admin') {
|
|||
if (($v_language != $_POST['v_language']) && (empty($_SESSION['error_msg']))) {
|
||||
$v_language = escapeshellarg($_POST['v_language']);
|
||||
exec (VESTA_CMD."v-change-user-language ".$v_username." ".$v_language, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
} else {
|
||||
$_SESSION['language'] = $_POST['v_language'];
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
if (empty($_SESSION['error_msg'])) $_SESSION['language'] = $_POST['v_language'];
|
||||
unset($output);
|
||||
}
|
||||
|
||||
|
@ -257,11 +213,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
if (($v_email != $_POST['v_email']) && (empty($_SESSION['error_msg']))) {
|
||||
$v_email = escapeshellarg($_POST['v_email']);
|
||||
exec (VESTA_CMD."v-change-user-contact ".$v_username." ".$v_email, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
}
|
||||
|
||||
|
@ -275,11 +227,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
if (!empty($_POST['v_ns3'])) $ns_cmd = $ns_cmd." ".$v_ns3;
|
||||
if (!empty($_POST['v_ns4'])) $ns_cmd = $ns_cmd." ".$v_ns4;
|
||||
exec ($ns_cmd, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,11 +28,8 @@ if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) {
|
|||
// Check domain
|
||||
$v_domain = escapeshellarg($_GET['domain']);
|
||||
exec (VESTA_CMD."v-list-web-domain ".$user." ".$v_domain." json", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
} else {
|
||||
check_return_code($return_var,$output);
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
$data = json_decode(implode('', $output), true);
|
||||
unset($output);
|
||||
$v_username = $user;
|
||||
|
@ -98,22 +95,14 @@ if (!empty($_POST['save'])) {
|
|||
if (($v_ip != $_POST['v_ip']) && (empty($_SESSION['error_msg']))) {
|
||||
$v_ip = escapeshellarg($_POST['v_ip']);
|
||||
exec (VESTA_CMD."v-change-web-domain-ip ".$v_username." ".$v_domain." ".$v_ip." 'no'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
$restart_web = 'yes';
|
||||
unset($output);
|
||||
exec (VESTA_CMD."v-list-dns-domain ".$v_username." ".$v_domain." json", $output, $return_var);
|
||||
if ((empty($_SESSION['error_msg'])) && ($return_var == 0 )) {
|
||||
unset($output);
|
||||
exec (VESTA_CMD."v-change-dns-domain-ip ".$v_username." ".$v_domain." ".$v_ip." 'no'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
$restart_dns = 'yes';
|
||||
}
|
||||
unset($output);
|
||||
|
@ -121,11 +110,7 @@ if (!empty($_POST['save'])) {
|
|||
exec (VESTA_CMD."v-list-dns-domain ".$v_username." '".$v_alias."' json", $output, $return_var);
|
||||
if ((empty($_SESSION['error_msg'])) && ($return_var == 0 )) {
|
||||
exec (VESTA_CMD."v-change-dns-domain-ip ".$v_username." '".$v_alias."' ".$v_ip, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
$restart_dns = 'yes';
|
||||
}
|
||||
unset($output);
|
||||
|
@ -136,11 +121,7 @@ if (!empty($_POST['save'])) {
|
|||
if (( $_SESSION['user'] == 'admin') && ($v_template != $_POST['v_template']) && (empty($_SESSION['error_msg']))) {
|
||||
$v_template = escapeshellarg($_POST['v_template']);
|
||||
exec (VESTA_CMD."v-change-web-domain-tpl ".$v_username." ".$v_domain." ".$v_template." 'no'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
$restart_web = 'yes';
|
||||
}
|
||||
|
@ -159,11 +140,7 @@ if (!empty($_POST['save'])) {
|
|||
$restart_web = 'yes';
|
||||
$v_template = escapeshellarg($_POST['v_template']);
|
||||
exec (VESTA_CMD."v-delete-web-domain-alias ".$v_username." ".$v_domain." '".$alias."' 'no'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
|
@ -171,11 +148,7 @@ if (!empty($_POST['save'])) {
|
|||
unset($output);
|
||||
if ($return_var == 0) {
|
||||
exec (VESTA_CMD."v-delete-dns-on-web-alias ".$v_username." ".$v_domain." '".$alias."' 'no'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
$restart_dns = 'yes';
|
||||
}
|
||||
unset($output);
|
||||
|
@ -189,22 +162,14 @@ if (!empty($_POST['save'])) {
|
|||
$restart_web = 'yes';
|
||||
$v_template = escapeshellarg($_POST['v_template']);
|
||||
exec (VESTA_CMD."v-add-web-domain-alias ".$v_username." ".$v_domain." '".$alias."' 'no'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
exec (VESTA_CMD."v-list-dns-domain ".$v_username." ".$v_domain, $output, $return_var);
|
||||
unset($output);
|
||||
if ($return_var == 0) {
|
||||
exec (VESTA_CMD."v-add-dns-on-web-alias ".$v_username." ".$v_domain." '".$alias."' 'no'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
$restart_dns = 'yes';
|
||||
}
|
||||
}
|
||||
|
@ -216,11 +181,7 @@ if (!empty($_POST['save'])) {
|
|||
// Proxy
|
||||
if ((!empty($v_proxy)) && (empty($_POST['v_proxy'])) && (empty($_SESSION['error_msg']))) {
|
||||
exec (VESTA_CMD."v-delete-web-domain-proxy ".$v_username." ".$v_domain." 'no'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
unset($v_proxy);
|
||||
$restart_proxy = 'yes';
|
||||
|
@ -235,11 +196,7 @@ if (!empty($_POST['save'])) {
|
|||
$ext = str_replace(', ', ",", $ext);
|
||||
if (!empty($_POST['v_proxy_template'])) $v_proxy_template = $_POST['v_proxy_template'];
|
||||
exec (VESTA_CMD."v-change-web-domain-proxy-tpl ".$v_username." ".$v_domain." ".escapeshellarg($v_proxy_template)." ".escapeshellarg($ext)." 'no'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
$v_proxy_ext = str_replace(',', ', ', $ext);
|
||||
unset($output);
|
||||
$restart_proxy = 'yes';
|
||||
|
@ -256,11 +213,7 @@ if (!empty($_POST['save'])) {
|
|||
$v_proxy_ext = str_replace(',', ', ', $ext);
|
||||
}
|
||||
exec (VESTA_CMD."v-add-web-domain-proxy ".$v_username." ".$v_domain." ".escapeshellarg($v_proxy_template)." ".escapeshellarg($ext)." 'no'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
$restart_proxy = 'yes';
|
||||
}
|
||||
|
@ -268,11 +221,7 @@ if (!empty($_POST['save'])) {
|
|||
// SSL
|
||||
if (( $v_ssl == 'yes' ) && (empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) {
|
||||
exec (VESTA_CMD."v-delete-web-domain-ssl ".$v_username." ".$v_domain." 'no'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
$v_ssl = 'no';
|
||||
$restart_web = 'yes';
|
||||
|
@ -307,11 +256,7 @@ if (!empty($_POST['save'])) {
|
|||
}
|
||||
|
||||
exec (VESTA_CMD."v-change-web-domain-sslcert ".$user." ".$v_domain." ".$tmpdir." 'no'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
$restart_web = 'yes';
|
||||
$v_ssl_crt = $_POST['v_ssl_crt'];
|
||||
|
@ -323,11 +268,7 @@ if (!empty($_POST['save'])) {
|
|||
if ( $v_ssl_home != $_POST['v_ssl_home'] ) {
|
||||
$v_ssl_home = escapeshellarg($_POST['v_ssl_home']);
|
||||
exec (VESTA_CMD."v-change-web-domain-sslhome ".$user." ".$v_domain." ".$v_ssl_home." 'no'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
$v_ssl_home = $_POST['v_ssl_home'];
|
||||
unset($output);
|
||||
}
|
||||
|
@ -371,11 +312,7 @@ if (!empty($_POST['save'])) {
|
|||
fclose($fp);
|
||||
}
|
||||
exec (VESTA_CMD."v-add-web-domain-ssl ".$user." ".$v_domain." ".$tmpdir." ".$v_ssl_home." 'no'", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
$v_ssl = 'yes';
|
||||
$restart_web = 'yes';
|
||||
|
@ -389,43 +326,27 @@ if (!empty($_POST['save'])) {
|
|||
// Web Stats
|
||||
if ((!empty($v_stats)) && ($_POST['v_stats'] == 'none') && (empty($_SESSION['error_msg']))) {
|
||||
exec (VESTA_CMD."v-delete-web-domain-stats ".$v_username." ".$v_domain, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
$v_stats = '';
|
||||
}
|
||||
if ((!empty($v_stats)) && ($_POST['v_stats'] != $v_stats) && (empty($_SESSION['error_msg']))) {
|
||||
$v_stats = escapeshellarg($_POST['v_stats']);
|
||||
exec (VESTA_CMD."v-change-web-domain-stats ".$v_username." ".$v_domain." ".$v_stats, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
}
|
||||
if ((empty($v_stats)) && ($_POST['v_stats'] != 'none') && (empty($_SESSION['error_msg']))) {
|
||||
$v_stats = escapeshellarg($_POST['v_stats']);
|
||||
exec (VESTA_CMD."v-add-web-domain-stats ".$v_username." ".$v_domain." ".$v_stats, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
}
|
||||
|
||||
// Web Stats Auth
|
||||
if ((!empty($v_stats_user)) && (empty($_POST['v_stats_auth'])) && (empty($_SESSION['error_msg']))) {
|
||||
exec (VESTA_CMD."v-delete-web-domain-stats-user ".$v_username." ".$v_domain, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
$v_stats_user = '';
|
||||
$v_stats_password = '';
|
||||
|
@ -446,11 +367,7 @@ if (!empty($_POST['save'])) {
|
|||
$v_stats_user = escapeshellarg($_POST['v_stats_user']);
|
||||
$v_stats_password = escapeshellarg($_POST['v_stats_password']);
|
||||
exec (VESTA_CMD."v-add-web-domain-stats-user ".$v_username." ".$v_domain." ".$v_stats_user." ".$v_stats_password, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
$v_stats_password = "••••••••";
|
||||
}
|
||||
|
@ -472,11 +389,7 @@ if (!empty($_POST['save'])) {
|
|||
$v_stats_user = escapeshellarg($_POST['v_stats_user']);
|
||||
$v_stats_password = escapeshellarg($_POST['v_stats_password']);
|
||||
exec (VESTA_CMD."v-add-web-domain-stats-user ".$v_username." ".$v_domain." ".$v_stats_user." ".$v_stats_password, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
$v_stats_password = "••••••••";
|
||||
}
|
||||
|
@ -485,11 +398,7 @@ if (!empty($_POST['save'])) {
|
|||
// Delete FTP Account
|
||||
if ((!empty($v_ftp_user)) && (empty($_POST['v_ftp'])) && (empty($_SESSION['error_msg']))) {
|
||||
exec (VESTA_CMD."v-delete-web-domain-ftp ".$v_username." ".$v_domain, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
$v_ftp= '';
|
||||
$v_ftp_user = '';
|
||||
|
@ -515,11 +424,7 @@ if (!empty($_POST['save'])) {
|
|||
$v_ftp_user = escapeshellarg($v_ftp_user);
|
||||
$v_ftp_password = escapeshellarg($_POST['v_ftp_password']);
|
||||
exec (VESTA_CMD."v-add-web-domain-ftp ".$v_username." ".$v_domain." ".$v_ftp_user." ".$v_ftp_password, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
$v_ftp= '';
|
||||
$v_ftp_user = $user."_".preg_replace("/^".$user."_/", "", $_POST['v_ftp_user']);
|
||||
|
@ -546,20 +451,15 @@ if (!empty($_POST['save'])) {
|
|||
$v_ftp_user = escapeshellarg($_POST['v_ftp_user']);
|
||||
$v_ftp_password = escapeshellarg($_POST['v_ftp_password']);
|
||||
exec (VESTA_CMD."v-add-web-domain-ftp ".$v_username." ".$v_domain." ".$v_ftp_user." ".$v_ftp_password, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
} else {
|
||||
if (!empty($_POST['v_ftp_email'])) {
|
||||
$to = $_POST['v_ftp_email'];
|
||||
$subject = __("FTP login credentials");
|
||||
$hostname = exec('hostname');
|
||||
$from = __('MAIL_FROM',$hostname);
|
||||
$mailtext .= __('FTP_ACCOUNT_READY',$_GET['domain'],$user,$_POST['v_ftp_user'],$_POST['v_ftp_password']);
|
||||
send_email($to, $subject, $mailtext, $from);
|
||||
unset($v_ftp_email);
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
if ((!empty($_POST['v_ftp_email'])) && (empty($_SESSION['error_msg']))) {
|
||||
$to = $_POST['v_ftp_email'];
|
||||
$subject = __("FTP login credentials");
|
||||
$hostname = exec('hostname');
|
||||
$from = __('MAIL_FROM',$hostname);
|
||||
$mailtext .= __('FTP_ACCOUNT_READY',$_GET['domain'],$user,$_POST['v_ftp_user'],$_POST['v_ftp_password']);
|
||||
send_email($to, $subject, $mailtext, $from);
|
||||
unset($v_ftp_email);
|
||||
}
|
||||
unset($output);
|
||||
$v_ftp_user = $user."_".$_POST['v_ftp_user'];
|
||||
|
@ -567,25 +467,18 @@ if (!empty($_POST['save'])) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// Restart web
|
||||
if (!empty($restart_web) && (empty($_SESSION['error_msg']))) {
|
||||
exec (VESTA_CMD."v-restart-web", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
}
|
||||
|
||||
// Restart dns
|
||||
if (!empty($restart_dns) && (empty($_SESSION['error_msg']))) {
|
||||
exec (VESTA_CMD."v-restart-dns", $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
check_return_code($return_var,$output);
|
||||
unset($output);
|
||||
}
|
||||
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
|
@ -600,7 +493,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
}
|
||||
unset($_SESSION['error_msg']);
|
||||
unset($_SESSION['ok_msg']);
|
||||
//}
|
||||
|
||||
|
||||
// Footer
|
||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue