mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-21 13:54:26 -07:00
i18n + service manager + web updater
This commit is contained in:
parent
3612d08933
commit
6e631c32a1
84 changed files with 1806 additions and 1458 deletions
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
// Init
|
||||
//error_reporting(NULL);
|
||||
error_reporting(NULL);
|
||||
ob_start();
|
||||
session_start();
|
||||
$TAB = 'CRON';
|
||||
|
@ -40,7 +40,7 @@ top_panel($user,$TAB);
|
|||
$error_msg = $error_msg.", ".$error;
|
||||
}
|
||||
}
|
||||
$_SESSION['error_msg'] = _('Error: field "%s" can not be blank.',$error_msg);
|
||||
$_SESSION['error_msg'] = _('Field "%s" can not be blank.',$error_msg);
|
||||
} else {
|
||||
// Add Cron Job
|
||||
exec (VESTA_CMD."v-add-cron-job ".$user." ".$v_min." ".$v_hour." ".$v_day." ".$v_month." ".$v_wday." ".$v_cmd, $output, $return_var);
|
||||
|
@ -48,12 +48,12 @@ top_panel($user,$TAB);
|
|||
$v_charset = $_POST['v_charset'];
|
||||
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($v_password);
|
||||
unset($output);
|
||||
} else {
|
||||
$_SESSION['ok_msg'] = _("OK: cron job has been created successfully.");
|
||||
$_SESSION['ok_msg'] = _('CRON_CREATED_OK');
|
||||
unset($v_min);
|
||||
unset($v_hour);
|
||||
unset($v_day);
|
||||
|
|
|
@ -23,7 +23,7 @@ if (!empty($_POST['ok'])) {
|
|||
if (empty($_POST['v_charset'])) $errors[] = _('charset');
|
||||
|
||||
// Check for errors
|
||||
if (empty($errors[0])) {
|
||||
if (!empty($errors[0])) {
|
||||
foreach ($errors as $i => $error) {
|
||||
if ( $i == 0 ) {
|
||||
$error_msg = $error;
|
||||
|
@ -31,7 +31,7 @@ if (!empty($_POST['ok'])) {
|
|||
$error_msg = $error_msg.", ".$error;
|
||||
}
|
||||
}
|
||||
$_SESSION['error_msg'] = _('Error: field "%s" can not be blank.',$error_msg);
|
||||
$_SESSION['error_msg'] = _('Field "%s" can not be blank.',$error_msg);
|
||||
}
|
||||
|
||||
// Validate email
|
||||
|
@ -59,7 +59,7 @@ if (!empty($_POST['ok'])) {
|
|||
$v_charset = $_POST['v_charset'];
|
||||
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($v_password);
|
||||
unset($output);
|
||||
|
@ -72,9 +72,7 @@ if (!empty($_POST['ok'])) {
|
|||
$subject = _("Database Credentials");
|
||||
$hostname = exec('hostname');
|
||||
$from = _('MAIL_FROM',$hostname);
|
||||
$mailtext = _('DATABASE_READY',$user,$_POST['v_database'],$user,$_POST['v_dbuser'],$_POST['v_password']);
|
||||
$mailtext .= $db_admin_link."\n\n";
|
||||
$mailtext .= "--\n"._('Vesta Control Panel')."\n";
|
||||
$mailtext = _('DATABASE_READY',$user."_".$_POST['v_database'],$user."_".$_POST['v_dbuser'],$_POST['v_password'],$db_admin_link);
|
||||
send_email($to, $subject, $mailtext, $from);
|
||||
}
|
||||
$_SESSION['ok_msg'] = _('DATABASE_CREATED_OK',$user."_".$_POST['v_database'],$user."_".$_POST['v_database']);
|
||||
|
|
|
@ -41,13 +41,13 @@ if (!empty($_POST['ok'])) {
|
|||
$error_msg = $error_msg.", ".$error;
|
||||
}
|
||||
}
|
||||
$_SESSION['error_msg'] = _('Error: field "%s" can not be blank.',$error_msg);
|
||||
$_SESSION['error_msg'] = _('Field "%s" can not be blank.',$error_msg);
|
||||
} else {
|
||||
// Add DNS
|
||||
exec (VESTA_CMD."v-add-dns-domain ".$user." ".$v_domain." ".$v_ip." ".$v_template." ".$v_ns1." ".$v_ns2." ".$v_ns3." ".$ns4, $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);
|
||||
|
@ -58,7 +58,7 @@ if (!empty($_POST['ok'])) {
|
|||
exec (VESTA_CMD."v-change-dns-domain-exp ".$user." ".$v_domain." ".$v_exp, $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);
|
||||
|
@ -70,14 +70,14 @@ if (!empty($_POST['ok'])) {
|
|||
exec (VESTA_CMD."v-change-dns-domain-ttl ".$user." ".$v_domain." ".$v_ttl, $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'] = _('DOMAIN_CREATED_OK',$_POST[v_domain],$_POST[v_domain]);
|
||||
$_SESSION['ok_msg'] = _('DNS_DOMAIN_CREATED_OK',$_POST[v_domain],$_POST[v_domain]);
|
||||
unset($v_domain);
|
||||
}
|
||||
}
|
||||
|
@ -107,19 +107,19 @@ if (!empty($_POST['ok_rec'])) {
|
|||
$error_msg = $error_msg.", ".$error;
|
||||
}
|
||||
}
|
||||
$_SESSION['error_msg'] = _('Error: field "%s" can not be blank.',$error_msg);
|
||||
$_SESSION['error_msg'] = _('Field "%s" can not be blank.',$error_msg);
|
||||
} else {
|
||||
// Add DNS Record
|
||||
exec (VESTA_CMD."v-add-dns-domain-record ".$user." ".$v_domain." ".$v_rec." ".$v_type." ".$v_val." ".$v_priority, $output, $return_var);
|
||||
$v_type = $_POST['v_type'];
|
||||
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'] = _('RECORD_CREATED_OK',$_POST[v_rec],$_POST[v_domain]);
|
||||
$_SESSION['ok_msg'] = _('DNS_RECORD_CREATED_OK',$_POST[v_rec],$_POST[v_domain]);
|
||||
unset($v_domain);
|
||||
unset($v_rec);
|
||||
unset($v_val);
|
||||
|
|
|
@ -46,7 +46,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
$error_msg = $error_msg.", ".$error;
|
||||
}
|
||||
}
|
||||
$_SESSION['error_msg'] = _('Error: field "%s" can not be blank.',$error_msg);
|
||||
$_SESSION['error_msg'] = _('Field "%s" can not be blank.',$error_msg);
|
||||
} else {
|
||||
// Add IP
|
||||
$v_interface = escapeshellarg($_POST['v_interface']);
|
||||
|
@ -56,7 +56,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
$v_interface = $_POST['v_interface'];
|
||||
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($v_password);
|
||||
unset($output);
|
||||
|
|
|
@ -48,20 +48,20 @@ top_panel($user,$TAB);
|
|||
$error_msg = $error_msg.", ".$error;
|
||||
}
|
||||
}
|
||||
$_SESSION['error_msg'] = _('Error: field "%s" can not be blank.',$error_msg);
|
||||
$_SESSION['error_msg'] = _('Field "%s" can not be blank.',$error_msg);
|
||||
} else {
|
||||
|
||||
// Add mail domain
|
||||
exec (VESTA_CMD."v-add-mail-domain ".$user." ".$v_domain." ".$v_antispam." ".$v_antivirus." ".$v_dkim, $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'] = _("DOMAIN_MAIL_CREATED_OK",$_POST['v_domain'],$_POST['v_domain']);
|
||||
$_SESSION['ok_msg'] = _('MAIL_DOMAIN_CREATED_OK',$_POST['v_domain'],$_POST['v_domain']);
|
||||
unset($v_domain);
|
||||
}
|
||||
}
|
||||
|
@ -95,13 +95,13 @@ top_panel($user,$TAB);
|
|||
$error_msg = $error_msg.", ".$error;
|
||||
}
|
||||
}
|
||||
$_SESSION['error_msg'] = _('Error: field "%s" can not be blank.',$error_msg);
|
||||
$_SESSION['error_msg'] = _('Field "%s" can not be blank.',$error_msg);
|
||||
} else {
|
||||
// Add Mail Account
|
||||
exec (VESTA_CMD."v-add-mail-account ".$user." ".$v_domain." ".$v_account." ".$v_password." ".$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;
|
||||
}
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
$error_msg = $error_msg.", ".$error;
|
||||
}
|
||||
}
|
||||
$_SESSION['error_msg'] = _('Error: field "%s" can not be blank.',$error_msg);
|
||||
$_SESSION['error_msg'] = _('Field "%s" can not be blank.',$error_msg);
|
||||
} else {
|
||||
exec ('mktemp -d', $output, $return_var);
|
||||
$tmpdir = $output[0];
|
||||
|
@ -107,7 +107,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
exec (VESTA_CMD."v-add-user-package ".$tmpdir." ".$v_package, $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);
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?php
|
||||
// Init
|
||||
error_reporting(NULL);
|
||||
ob_start();
|
||||
session_start();
|
||||
$TAB = 'USER';
|
||||
|
@ -51,32 +50,32 @@ if ($_SESSION['user'] == 'admin') {
|
|||
$error_msg = $error_msg.", ".$error;
|
||||
}
|
||||
}
|
||||
$_SESSION['error_msg'] = _('Error: field "%s" can not be blank.',$error_msg);
|
||||
$_SESSION['error_msg'] = _('Field "%s" can not be blank.',$error_msg);
|
||||
}
|
||||
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
exec (VESTA_CMD."v-add-user ".$v_username." ".$v_password." ".$v_email." ".$v_package." ".$v_fname." ".$v_lname, $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 {
|
||||
exec (VESTA_CMD."v-change-user-language ".$v_username." ".$v_language, $output, $return_var);
|
||||
if (!empty($v_notify)) {
|
||||
$to = $_POST['v_notify'];
|
||||
$subject = _translate($v_language,"Welcome to Vesta Control Panel");
|
||||
$subject = _translate($_POST['v_language'],"Welcome to Vesta Control Panel");
|
||||
$hostname = exec('hostname');
|
||||
$from = _translate($v_language,'MAIL_FROM',$hostname);
|
||||
$from = _translate($_POST['v_language'],'MAIL_FROM',$hostname);
|
||||
if (!empty($_POST['v_fname'])) {
|
||||
$mailtext = _translate($v_language,'GREETINGS_GORDON_FREEMAN',$_POST['v_fname'],$_POST['v_lname']);
|
||||
$mailtext = _translate($_POST['v_language'],'GREETINGS_GORDON_FREEMAN',$_POST['v_fname'],$_POST['v_lname']);
|
||||
} else {
|
||||
$mailtext = _translate($v_language,'GREETINGS');
|
||||
$mailtext = _translate($_POST['v_language'],'GREETINGS');
|
||||
}
|
||||
$mailtext .= _translate($v_language,'ACCOUNT_READY',$_SERVER['HTTP_HOST'],$_POST['v_username'],$_POST['v_password']);
|
||||
$mailtext .= _translate($_POST['v_language'],'ACCOUNT_READY',$_SERVER['HTTP_HOST'],$_POST['v_username'],$_POST['v_password']);
|
||||
send_email($to, $subject, $mailtext, $from);
|
||||
}
|
||||
|
||||
$_SESSION['ok_msg'] = _('ACCOUNT_CREATED_OK',$_POST[v_username],$_POST[v_username]);
|
||||
$_SESSION['ok_msg'] = _('USER_CREATED_OK',$_POST[v_username],$_POST[v_username]);
|
||||
unset($v_username);
|
||||
unset($v_password);
|
||||
unset($v_email);
|
||||
|
|
|
@ -79,7 +79,7 @@ $v_ftp_email = $panel[$user]['CONTACT'];
|
|||
$error_msg = $error_msg.", ".$error;
|
||||
}
|
||||
}
|
||||
$_SESSION['error_msg'] = _('Error: field "%s" can not be blank.',$error_msg);
|
||||
$_SESSION['error_msg'] = _('Field "%s" can not be blank.',$error_msg);
|
||||
}
|
||||
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
|
@ -87,7 +87,7 @@ $v_ftp_email = $panel[$user]['CONTACT'];
|
|||
exec (VESTA_CMD."v-add-web-domain ".$user." ".$v_domain." ".$v_ip." ".$v_template." 'no'", $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);
|
||||
|
@ -97,7 +97,7 @@ $v_ftp_email = $panel[$user]['CONTACT'];
|
|||
exec (VESTA_CMD."v-add-dns-domain ".$user." ".$v_domain." ".$v_ip, $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);
|
||||
|
@ -108,7 +108,7 @@ $v_ftp_email = $panel[$user]['CONTACT'];
|
|||
exec (VESTA_CMD."v-add-mail-domain ".$user." ".$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;
|
||||
}
|
||||
unset($output);
|
||||
|
@ -130,7 +130,7 @@ $v_ftp_email = $panel[$user]['CONTACT'];
|
|||
exec (VESTA_CMD."v-add-web-domain-alias ".$user." ".$v_domain." ".$alias." 'no'", $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;
|
||||
}
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ $v_ftp_email = $panel[$user]['CONTACT'];
|
|||
exec (VESTA_CMD."v-add-dns-on-web-alias ".$user." ".$v_domain." ".$alias." 'no'", $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);
|
||||
|
@ -154,7 +154,7 @@ $v_ftp_email = $panel[$user]['CONTACT'];
|
|||
exec (VESTA_CMD."v-delete-web-domain-alias ".$user." ".$v_domain." ".$alias." 'no'", $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;
|
||||
}
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ $v_ftp_email = $panel[$user]['CONTACT'];
|
|||
exec (VESTA_CMD."v-add-web-domain-nginx ".$user." ".$v_domain." 'default' ".$ext." 'no'", $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);
|
||||
|
@ -206,7 +206,7 @@ $v_ftp_email = $panel[$user]['CONTACT'];
|
|||
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: vesta did not return any output.');
|
||||
if (empty($error)) $error = _('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
unset($output);
|
||||
|
@ -218,7 +218,7 @@ $v_ftp_email = $panel[$user]['CONTACT'];
|
|||
exec (VESTA_CMD."v-add-web-domain-stats ".$user." ".$v_domain." ".$v_stats, $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);
|
||||
|
@ -229,7 +229,7 @@ $v_ftp_email = $panel[$user]['CONTACT'];
|
|||
exec (VESTA_CMD."v-add-web-domain-stats-user ".$user." ".$v_domain." ".$v_stats_user." ".$v_stats_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;
|
||||
}
|
||||
unset($v_stats_user);
|
||||
|
@ -246,7 +246,7 @@ $v_ftp_email = $panel[$user]['CONTACT'];
|
|||
exec (VESTA_CMD."v-add-web-domain-ftp ".$user." ".$v_domain." ".$v_ftp_user." ".$v_ftp_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;
|
||||
} else {
|
||||
if (!empty($v_ftp_email)) {
|
||||
|
@ -269,7 +269,7 @@ $v_ftp_email = $panel[$user]['CONTACT'];
|
|||
exec (VESTA_CMD."v-restart-dns", $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);
|
||||
|
@ -279,7 +279,7 @@ $v_ftp_email = $panel[$user]['CONTACT'];
|
|||
exec (VESTA_CMD."v-restart-web", $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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue