i18n + service manager + web updater

This commit is contained in:
Serghey Rodin 2013-01-29 00:18:09 +02:00
commit 6e631c32a1
84 changed files with 1806 additions and 1458 deletions

View file

@ -33,7 +33,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
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: vesta did not return any output.');
if (empty($error)) $error = _('Error code:',$return_var);
$_SESSION['error_msg'] = $error;
} else {
$data = json_decode(implode('', $output), true);
@ -62,7 +62,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
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: vesta did not return any output.');
if (empty($error)) $error = _('Error code:',$return_var);
$_SESSION['error_msg'] = $error;
}
$v_antispam = 'no';
@ -72,7 +72,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
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: vesta did not return any output.');
if (empty($error)) $error = _('Error code:',$return_var);
$_SESSION['error_msg'] = $error;
}
$v_antispam = 'yes';
@ -83,7 +83,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
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: vesta did not return any output.');
if (empty($error)) $error = _('Error code:',$return_var);
$_SESSION['error_msg'] = $error;
}
$v_antivirus = 'no';
@ -93,14 +93,14 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
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: vesta did not return any output.');
if (empty($error)) $error = _('Error code:',$return_var);
$_SESSION['error_msg'] = $error;
}
$v_antivirus = 'yes';
unset($output);
}
if (empty($_SESSION['error_msg'])) {
$_SESSION['ok_msg'] = _('OK: changes has been saved.');
$_SESSION['ok_msg'] = _('Changes has been saved.');
}
// DKIM
@ -108,7 +108,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
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: vesta did not return any output.');
if (empty($error)) $error = _('Error code:',$return_var);
$_SESSION['error_msg'] = $error;
}
$v_dkim = 'no';
@ -118,7 +118,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
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: vesta did not return any output.');
if (empty($error)) $error = _('Error code:',$return_var);
$_SESSION['error_msg'] = $error;
}
$v_dkim = 'yes';
@ -130,7 +130,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
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: vesta did not return any output.');
if (empty($error)) $error = _('Error code:',$return_var);
$_SESSION['error_msg'] = $error;
}
$v_catchall = '';
@ -142,7 +142,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
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: vesta did not return any output.');
if (empty($error)) $error = _('Error code:',$return_var);
$_SESSION['error_msg'] = $error;
}
unset($output);
@ -153,13 +153,13 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
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: vesta did not return any output.');
if (empty($error)) $error = _('Error code:',$return_var);
$_SESSION['error_msg'] = $error;
}
unset($output);
}
if (empty($_SESSION['error_msg'])) {
$_SESSION['ok_msg'] = _('OK: changes has been saved.');
$_SESSION['ok_msg'] = _('Changes has been saved.');
}
}
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_mail.html');
@ -172,7 +172,7 @@ if ((!empty($_GET['domain'])) && (empty($_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: vesta did not return any output.');
if (empty($error)) $error = _('Error code:',$return_var);
$_SESSION['error_msg'] = $error;
} else {
$data = json_decode(implode('', $output), true);
@ -213,7 +213,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
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: vesta did not return any output.');
if (empty($error)) $error = _('Error code:',$return_var);
$_SESSION['error_msg'] = $error;
}
$v_password = "••••••••";
@ -230,7 +230,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
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: vesta did not return any output.');
if (empty($error)) $error = _('Error code:',$return_var);
$_SESSION['error_msg'] = $error;
}
unset($output);
@ -250,7 +250,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
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: vesta did not return any output.');
if (empty($error)) $error = _('Error code:',$return_var);
$_SESSION['error_msg'] = $error;
}
unset($output);
@ -262,7 +262,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
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: vesta did not return any output.');
if (empty($error)) $error = _('Error code:',$return_var);
$_SESSION['error_msg'] = $error;
}
unset($output);
@ -283,7 +283,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
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: vesta did not return any output.');
if (empty($error)) $error = _('Error code:',$return_var);
$_SESSION['error_msg'] = $error;
}
unset($output);
@ -295,7 +295,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
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: vesta did not return any output.');
if (empty($error)) $error = _('Error code:',$return_var);
$_SESSION['error_msg'] = $error;
}
unset($output);
@ -308,7 +308,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
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: vesta did not return any output.');
if (empty($error)) $error = _('Error code:',$return_var);
$_SESSION['error_msg'] = $error;
}
unset($output);
@ -322,7 +322,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
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: vesta did not return any output.');
if (empty($error)) $error = _('Error code:',$return_var);
$_SESSION['error_msg'] = $error;
}
unset($output);
@ -330,14 +330,14 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
}
}
if (($v_autoreply == 'no') && (!empty($_POST['v_autoreply'])) && (empty($_SESSION['error_msg']))) {
if (empty($_POST['v_autoreply_message'])) $_SESSION['error_msg'] = "Error: field atoreply message can not be blank.";
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: vesta did not return any output.');
if (empty($error)) $error = _('Error code:',$return_var);
$_SESSION['error_msg'] = $error;
}
unset($output);
@ -347,7 +347,7 @@ if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
}
if (empty($_SESSION['error_msg'])) {
$_SESSION['ok_msg'] = _('OK: changes has been saved.');
$_SESSION['ok_msg'] = _('Changes has been saved.');
}
}
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_mail_acc.html');