mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-14 18:49:17 -07:00
changed tranlsate function name from _() to __()
This commit is contained in:
parent
83673da05f
commit
25c2b5c4cb
104 changed files with 1277 additions and 1277 deletions
|
@ -16,12 +16,12 @@ top_panel($user,$TAB);
|
|||
//if ($_SESSION['user'] == 'admin') {
|
||||
if (!empty($_POST['ok'])) {
|
||||
// Check input
|
||||
if (empty($_POST['v_min'])) $errors[] = _('minute');
|
||||
if (empty($_POST['v_hour'])) $errors[] = _('hour');
|
||||
if (empty($_POST['v_day'])) $errors[] = _('day');
|
||||
if (empty($_POST['v_month'])) $errors[] = _('month');
|
||||
if (empty($_POST['v_wday'])) $errors[] = _('day of week');
|
||||
if (empty($_POST['v_cmd'])) $errors[] = _('cmd');
|
||||
if (empty($_POST['v_min'])) $errors[] = __('minute');
|
||||
if (empty($_POST['v_hour'])) $errors[] = __('hour');
|
||||
if (empty($_POST['v_day'])) $errors[] = __('day');
|
||||
if (empty($_POST['v_month'])) $errors[] = __('month');
|
||||
if (empty($_POST['v_wday'])) $errors[] = __('day of week');
|
||||
if (empty($_POST['v_cmd'])) $errors[] = __('cmd');
|
||||
|
||||
// Protect input
|
||||
$v_min = escapeshellarg($_POST['v_min']);
|
||||
|
@ -40,7 +40,7 @@ top_panel($user,$TAB);
|
|||
$error_msg = $error_msg.", ".$error;
|
||||
}
|
||||
}
|
||||
$_SESSION['error_msg'] = _('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 code:',$return_var);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
unset($v_password);
|
||||
unset($output);
|
||||
} else {
|
||||
$_SESSION['ok_msg'] = _('CRON_CREATED_OK');
|
||||
$_SESSION['ok_msg'] = __('CRON_CREATED_OK');
|
||||
unset($v_min);
|
||||
unset($v_hour);
|
||||
unset($v_day);
|
||||
|
|
|
@ -16,11 +16,11 @@ $v_db_email = $panel[$user]['CONTACT'];
|
|||
|
||||
if (!empty($_POST['ok'])) {
|
||||
// Check input
|
||||
if (empty($_POST['v_database'])) $errors[] = _('database');
|
||||
if (empty($_POST['v_dbuser'])) $errors[] = _('username');
|
||||
if (empty($_POST['v_password'])) $errors[] = _('password');
|
||||
if (empty($_POST['v_type'])) $errors[] = _('type');
|
||||
if (empty($_POST['v_charset'])) $errors[] = _('charset');
|
||||
if (empty($_POST['v_database'])) $errors[] = __('database');
|
||||
if (empty($_POST['v_dbuser'])) $errors[] = __('username');
|
||||
if (empty($_POST['v_password'])) $errors[] = __('password');
|
||||
if (empty($_POST['v_type'])) $errors[] = __('type');
|
||||
if (empty($_POST['v_charset'])) $errors[] = __('charset');
|
||||
|
||||
// Check for errors
|
||||
if (!empty($errors[0])) {
|
||||
|
@ -31,13 +31,13 @@ if (!empty($_POST['ok'])) {
|
|||
$error_msg = $error_msg.", ".$error;
|
||||
}
|
||||
}
|
||||
$_SESSION['error_msg'] = _('Field "%s" can not be blank.',$error_msg);
|
||||
$_SESSION['error_msg'] = __('Field "%s" can not be blank.',$error_msg);
|
||||
}
|
||||
|
||||
// Validate email
|
||||
if (!empty($_POST['v_db_email'])) {
|
||||
if (!filter_var($_POST['v_db_email'], FILTER_VALIDATE_EMAIL)) {
|
||||
$_SESSION['error_msg'] = _('Please enter valid email address.');
|
||||
$_SESSION['error_msg'] = __('Please enter valid email address.');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ if (!empty($_POST['ok'])) {
|
|||
// Check password length
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
$pw_len = strlen($_POST['v_password']);
|
||||
if ($pw_len < 6 ) $_SESSION['error_msg'] = _('Password is too short.',$error_msg);
|
||||
if ($pw_len < 6 ) $_SESSION['error_msg'] = __('Password is too short.',$error_msg);
|
||||
}
|
||||
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
|
@ -64,7 +64,7 @@ if (!empty($_POST['ok'])) {
|
|||
$v_charset = $_POST['v_charset'];
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = _('Error code:',$return_var);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
unset($v_password);
|
||||
unset($output);
|
||||
|
@ -74,13 +74,13 @@ if (!empty($_POST['ok'])) {
|
|||
if ($_POST['v_type'] == 'mysql') $db_admin_link = "http://".$http_host."/phpMyAdmin/";
|
||||
if ($_POST['v_type'] == 'pgsql') $db_admin_link = "http://".$http_host."/phpPgAdmin/";
|
||||
$to = $v_db_email;
|
||||
$subject = _("Database Credentials");
|
||||
$subject = __("Database Credentials");
|
||||
$hostname = exec('hostname');
|
||||
$from = _('MAIL_FROM',$hostname);
|
||||
$mailtext = _('DATABASE_READY',$user."_".$_POST['v_database'],$user."_".$_POST['v_dbuser'],$_POST['v_password'],$db_admin_link);
|
||||
$from = __('MAIL_FROM',$hostname);
|
||||
$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']);
|
||||
$_SESSION['ok_msg'] = __('DATABASE_CREATED_OK',$user."_".$_POST['v_database'],$user."_".$_POST['v_database']);
|
||||
unset($v_database);
|
||||
unset($v_dbuser);
|
||||
unset($v_password);
|
||||
|
|
|
@ -14,8 +14,8 @@ top_panel($user,$TAB);
|
|||
|
||||
if (!empty($_POST['ok'])) {
|
||||
// Check input
|
||||
if (empty($_POST['v_domain'])) $errors[] = _('domain');
|
||||
if (empty($_POST['v_ip'])) $errors[] = _('ip');
|
||||
if (empty($_POST['v_domain'])) $errors[] = __('domain');
|
||||
if (empty($_POST['v_ip'])) $errors[] = __('ip');
|
||||
|
||||
// Protect input
|
||||
$v_domain = preg_replace("/^www./i", "", $_POST['v_domain']);
|
||||
|
@ -41,13 +41,13 @@ if (!empty($_POST['ok'])) {
|
|||
$error_msg = $error_msg.", ".$error;
|
||||
}
|
||||
}
|
||||
$_SESSION['error_msg'] = _('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 code:',$return_var);
|
||||
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 code:',$return_var);
|
||||
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 code:',$return_var);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
unset($output);
|
||||
}
|
||||
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
$_SESSION['ok_msg'] = _('DNS_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'] = _('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 code:',$return_var);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
unset($output);
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
$_SESSION['ok_msg'] = _('DNS_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);
|
||||
|
|
|
@ -16,10 +16,10 @@ top_panel($user,$TAB);
|
|||
if ($_SESSION['user'] == 'admin') {
|
||||
if (!empty($_POST['ok'])) {
|
||||
// Check input
|
||||
if (empty($_POST['v_ip'])) $errors[] = _('ip address');
|
||||
if (empty($_POST['v_netmask'])) $errors[] = _('netmask');
|
||||
if (empty($_POST['v_interface'])) $errors[] = _('interface');
|
||||
if (empty($_POST['v_owner'])) $errors[] = _('assigned user');
|
||||
if (empty($_POST['v_ip'])) $errors[] = __('ip address');
|
||||
if (empty($_POST['v_netmask'])) $errors[] = __('netmask');
|
||||
if (empty($_POST['v_interface'])) $errors[] = __('interface');
|
||||
if (empty($_POST['v_owner'])) $errors[] = __('assigned user');
|
||||
|
||||
// Protect input
|
||||
$v_ip = escapeshellarg($_POST['v_ip']);
|
||||
|
@ -47,7 +47,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
$error_msg = $error_msg.", ".$error;
|
||||
}
|
||||
}
|
||||
$_SESSION['error_msg'] = _('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']);
|
||||
|
@ -57,12 +57,12 @@ if ($_SESSION['user'] == 'admin') {
|
|||
$v_interface = $_POST['v_interface'];
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = _('Error code:',$return_var);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
unset($v_password);
|
||||
unset($output);
|
||||
} else {
|
||||
$_SESSION['ok_msg'] = _('IP_CREATED_OK',$_POST['v_ip'],$_POST['v_ip']);
|
||||
$_SESSION['ok_msg'] = __('IP_CREATED_OK',$_POST['v_ip'],$_POST['v_ip']);
|
||||
unset($v_ip);
|
||||
unset($v_netmask);
|
||||
unset($v_name);
|
||||
|
|
|
@ -16,7 +16,7 @@ top_panel($user,$TAB);
|
|||
//if ($_SESSION['user'] == 'admin') {
|
||||
// Mail Domain
|
||||
if (!empty($_POST['ok'])) {
|
||||
if (empty($_POST['v_domain'])) $errors[] = _('domain');
|
||||
if (empty($_POST['v_domain'])) $errors[] = __('domain');
|
||||
if (!empty($_POST['v_antispam'])) {
|
||||
$v_antispam = 'yes';
|
||||
} else {
|
||||
|
@ -48,20 +48,20 @@ top_panel($user,$TAB);
|
|||
$error_msg = $error_msg.", ".$error;
|
||||
}
|
||||
}
|
||||
$_SESSION['error_msg'] = _('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 code:',$return_var);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
unset($output);
|
||||
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
$_SESSION['ok_msg'] = _('MAIL_DOMAIN_CREATED_OK',$_POST['v_domain'],$_POST['v_domain']);
|
||||
$_SESSION['ok_msg'] = __('MAIL_DOMAIN_CREATED_OK',$_POST['v_domain'],$_POST['v_domain']);
|
||||
unset($v_domain);
|
||||
}
|
||||
}
|
||||
|
@ -71,9 +71,9 @@ top_panel($user,$TAB);
|
|||
// Mail Account
|
||||
if (!empty($_POST['ok_acc'])) {
|
||||
// Check input
|
||||
if (empty($_POST['v_domain'])) $errors[] = _('domain');
|
||||
if (empty($_POST['v_account'])) $errors[] = _('account');
|
||||
if (empty($_POST['v_password'])) $errors[] = _('password');
|
||||
if (empty($_POST['v_domain'])) $errors[] = __('domain');
|
||||
if (empty($_POST['v_account'])) $errors[] = __('account');
|
||||
if (empty($_POST['v_password'])) $errors[] = __('password');
|
||||
|
||||
// Protect input
|
||||
$v_domain = escapeshellarg($_POST['v_domain']);
|
||||
|
@ -95,13 +95,13 @@ top_panel($user,$TAB);
|
|||
$error_msg = $error_msg.", ".$error;
|
||||
}
|
||||
}
|
||||
$_SESSION['error_msg'] = _('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 code:',$return_var);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
|
||||
|
@ -118,7 +118,7 @@ top_panel($user,$TAB);
|
|||
exec (VESTA_CMD."v-add-mail-account-alias ".$user." ".$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: vesta did not return any output.');
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ top_panel($user,$TAB);
|
|||
exec (VESTA_CMD."v-add-mail-account-forward ".$user." ".$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: vesta did not return any output.');
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ top_panel($user,$TAB);
|
|||
|
||||
unset($output);
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
$_SESSION['ok_msg'] = _('MAIL_ACCOUNT_CREATED_OK',$_POST['v_account'],$_POST[v_domain],$_POST['v_account'],$_POST[v_domain]);
|
||||
$_SESSION['ok_msg'] = __('MAIL_ACCOUNT_CREATED_OK',$_POST['v_account'],$_POST[v_domain],$_POST['v_account'],$_POST[v_domain]);
|
||||
unset($v_account);
|
||||
unset($v_password);
|
||||
unset($v_password);
|
||||
|
|
|
@ -20,22 +20,22 @@ top_panel($user,$TAB);
|
|||
if ($_SESSION['user'] == 'admin') {
|
||||
if (!empty($_POST['ok'])) {
|
||||
// Check input
|
||||
if (empty($_POST['v_package'])) $errors[] = _('package');
|
||||
if (empty($_POST['v_template'])) $errors[] = _('template');
|
||||
if (empty($_POST['v_shell'])) $errrors[] = _('shell');
|
||||
if (!isset($_POST['v_web_domains'])) $errors[] = _('web domains');
|
||||
if (!isset($_POST['v_web_aliases'])) $errors[] = _('web aliases');
|
||||
if (!isset($_POST['v_dns_domains'])) $errors[] = _('dns domains');
|
||||
if (!isset($_POST['v_dns_records'])) $errors[] = _('dns records');
|
||||
if (!isset($_POST['v_mail_domains'])) $errors[] = _('mail domains');
|
||||
if (!isset($_POST['v_mail_accounts'])) $errors[] = _('mail accounts');
|
||||
if (!isset($_POST['v_databases'])) $errors[] = _('databases');
|
||||
if (!isset($_POST['v_cron_jobs'])) $errors[] = _('cron jobs');
|
||||
if (!isset($_POST['v_backups'])) $errors[] = _('backups');
|
||||
if (!isset($_POST['v_disk_quota'])) $errors[] = _('quota');
|
||||
if (!isset($_POST['v_bandwidth'])) $errors[] = _('bandwidth');
|
||||
if (empty($_POST['v_ns1'])) $errors[] = _('ns1');
|
||||
if (empty($_POST['v_ns2'])) $errors[] = _('ns2');
|
||||
if (empty($_POST['v_package'])) $errors[] = __('package');
|
||||
if (empty($_POST['v_template'])) $errors[] = __('template');
|
||||
if (empty($_POST['v_shell'])) $errrors[] = __('shell');
|
||||
if (!isset($_POST['v_web_domains'])) $errors[] = __('web domains');
|
||||
if (!isset($_POST['v_web_aliases'])) $errors[] = __('web aliases');
|
||||
if (!isset($_POST['v_dns_domains'])) $errors[] = __('dns domains');
|
||||
if (!isset($_POST['v_dns_records'])) $errors[] = __('dns records');
|
||||
if (!isset($_POST['v_mail_domains'])) $errors[] = __('mail domains');
|
||||
if (!isset($_POST['v_mail_accounts'])) $errors[] = __('mail accounts');
|
||||
if (!isset($_POST['v_databases'])) $errors[] = __('databases');
|
||||
if (!isset($_POST['v_cron_jobs'])) $errors[] = __('cron jobs');
|
||||
if (!isset($_POST['v_backups'])) $errors[] = __('backups');
|
||||
if (!isset($_POST['v_disk_quota'])) $errors[] = __('quota');
|
||||
if (!isset($_POST['v_bandwidth'])) $errors[] = __('bandwidth');
|
||||
if (empty($_POST['v_ns1'])) $errors[] = __('ns1');
|
||||
if (empty($_POST['v_ns2'])) $errors[] = __('ns2');
|
||||
|
||||
|
||||
// Protect input
|
||||
|
@ -73,7 +73,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
$error_msg = $error_msg.", ".$error;
|
||||
}
|
||||
}
|
||||
$_SESSION['error_msg'] = _('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 code:',$return_var);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
unset($output);
|
||||
|
@ -119,7 +119,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
|
||||
// Check output
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
$_SESSION['ok_msg'] = _('PACKAGE_CREATED_OK',$_POST['v_package'],$_POST['v_package']);
|
||||
$_SESSION['ok_msg'] = __('PACKAGE_CREATED_OK',$_POST['v_package'],$_POST['v_package']);
|
||||
unset($v_package);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,12 +19,12 @@ top_panel($user,$TAB);
|
|||
if ($_SESSION['user'] == 'admin') {
|
||||
if (!empty($_POST['ok'])) {
|
||||
// Check input
|
||||
if (empty($_POST['v_username'])) $errors[] = _('user');
|
||||
if (empty($_POST['v_password'])) $errors[] = _('password');
|
||||
if (empty($_POST['v_package'])) $errrors[] = _('package');
|
||||
if (empty($_POST['v_email'])) $errors[] = _('email');
|
||||
if (empty($_POST['v_fname'])) $errors[] = _('first name');
|
||||
if (empty($_POST['v_lname'])) $errors[] = _('last name');
|
||||
if (empty($_POST['v_username'])) $errors[] = __('user');
|
||||
if (empty($_POST['v_password'])) $errors[] = __('password');
|
||||
if (empty($_POST['v_package'])) $errrors[] = __('package');
|
||||
if (empty($_POST['v_email'])) $errors[] = __('email');
|
||||
if (empty($_POST['v_fname'])) $errors[] = __('first name');
|
||||
if (empty($_POST['v_lname'])) $errors[] = __('last name');
|
||||
|
||||
// Protect input
|
||||
$v_username = escapeshellarg($_POST['v_username']);
|
||||
|
@ -38,7 +38,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
|
||||
// Validate email
|
||||
if (!filter_var($_POST['v_email'], FILTER_VALIDATE_EMAIL)) {
|
||||
$_SESSION['error_msg'] = _('Please enter valid email address.');
|
||||
$_SESSION['error_msg'] = __('Please enter valid email address.');
|
||||
}
|
||||
|
||||
// Check for errors
|
||||
|
@ -50,20 +50,20 @@ if ($_SESSION['user'] == 'admin') {
|
|||
$error_msg = $error_msg.", ".$error;
|
||||
}
|
||||
}
|
||||
$_SESSION['error_msg'] = _('Field "%s" can not be blank.',$error_msg);
|
||||
$_SESSION['error_msg'] = __('Field "%s" can not be blank.',$error_msg);
|
||||
}
|
||||
|
||||
// Check password length
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
$pw_len = strlen($_POST['v_password']);
|
||||
if ($pw_len < 6 ) $_SESSION['error_msg'] = _('Password is too short.',$error_msg);
|
||||
if ($pw_len < 6 ) $_SESSION['error_msg'] = __('Password is too short.',$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 code:',$return_var);
|
||||
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);
|
||||
|
@ -81,7 +81,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
send_email($to, $subject, $mailtext, $from);
|
||||
}
|
||||
|
||||
$_SESSION['ok_msg'] = _('USER_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);
|
||||
|
|
|
@ -14,12 +14,12 @@ top_panel($user,$TAB);
|
|||
$v_ftp_email = $panel[$user]['CONTACT'];
|
||||
if (!empty($_POST['ok'])) {
|
||||
// Check input
|
||||
if (empty($_POST['v_domain'])) $errors[] = _('domain');
|
||||
if (empty($_POST['v_ip'])) $errors[] = _('ip');
|
||||
if ((!empty($_POST['v_ssl'])) && (empty($_POST['v_ssl_crt']))) $errors[] = _('ssl certificate');
|
||||
if ((!empty($_POST['v_ssl'])) && (empty($_POST['v_ssl_key']))) $errors[] = _('ssl key');
|
||||
if ((!empty($_POST['v_stats_user'])) && (empty($_POST['v_stats_password']))) $errors[] = _('stats user password');
|
||||
if ((!empty($_POST['v_ftp_user'])) && (empty($_POST['v_ftp_password']))) $errors[] = _('ftp user password');
|
||||
if (empty($_POST['v_domain'])) $errors[] = __('domain');
|
||||
if (empty($_POST['v_ip'])) $errors[] = __('ip');
|
||||
if ((!empty($_POST['v_ssl'])) && (empty($_POST['v_ssl_crt']))) $errors[] = __('ssl certificate');
|
||||
if ((!empty($_POST['v_ssl'])) && (empty($_POST['v_ssl_key']))) $errors[] = __('ssl key');
|
||||
if ((!empty($_POST['v_stats_user'])) && (empty($_POST['v_stats_password']))) $errors[] = __('stats user password');
|
||||
if ((!empty($_POST['v_ftp_user'])) && (empty($_POST['v_ftp_password']))) $errors[] = __('ftp user password');
|
||||
|
||||
if ((!empty($_POST['v_aliases'])) && ($_POST['v_aliases'] != 'www.'.$_POST['v_domain'])) $v_adv = 'yes';
|
||||
if ((!empty($_POST['v_ssl'])) || (!empty($_POST['v_elog']))) $v_adv = 'yes';
|
||||
|
@ -67,14 +67,14 @@ $v_ftp_email = $panel[$user]['CONTACT'];
|
|||
|
||||
// Validate email
|
||||
if ((!empty($_POST['v_ftp_email'])) && (!filter_var($_POST['v_ftp_email'], FILTER_VALIDATE_EMAIL))) {
|
||||
$_SESSION['error_msg'] = _('Please enter valid email address.');
|
||||
$_SESSION['error_msg'] = __('Please enter valid email address.');
|
||||
}
|
||||
|
||||
// Check ftp password length
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
if (!empty($_POST['v_ftp_user'])) {
|
||||
$pw_len = strlen($_POST['v_ftp_password']);
|
||||
if ($pw_len < 6 ) $_SESSION['error_msg'] = _('Password is too short.',$error_msg);
|
||||
if ($pw_len < 6 ) $_SESSION['error_msg'] = __('Password is too short.',$error_msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -82,7 +82,7 @@ $v_ftp_email = $panel[$user]['CONTACT'];
|
|||
if (empty($_SESSION['error_msg'])) {
|
||||
if (!empty($_POST['v_stats_user'])) {
|
||||
$pw_len = strlen($_POST['v_stats_password']);
|
||||
if ($pw_len < 6 ) $_SESSION['error_msg'] = _('Password is too short.',$error_msg);
|
||||
if ($pw_len < 6 ) $_SESSION['error_msg'] = __('Password is too short.',$error_msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,7 @@ $v_ftp_email = $panel[$user]['CONTACT'];
|
|||
$error_msg = $error_msg.", ".$error;
|
||||
}
|
||||
}
|
||||
$_SESSION['error_msg'] = _('Field "%s" can not be blank.',$error_msg);
|
||||
$_SESSION['error_msg'] = __('Field "%s" can not be blank.',$error_msg);
|
||||
}
|
||||
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
|
@ -103,7 +103,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 code:',$return_var);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
unset($output);
|
||||
|
@ -113,7 +113,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 code:',$return_var);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
unset($output);
|
||||
|
@ -124,7 +124,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 code:',$return_var);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
unset($output);
|
||||
|
@ -146,7 +146,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 code:',$return_var);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
}
|
||||
|
@ -155,7 +155,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 code:',$return_var);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
unset($output);
|
||||
|
@ -170,7 +170,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 code:',$return_var);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
}
|
||||
|
@ -183,7 +183,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 code:',$return_var);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
unset($output);
|
||||
|
@ -222,7 +222,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 code:',$return_var);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
unset($output);
|
||||
|
@ -234,7 +234,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 code:',$return_var);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
unset($output);
|
||||
|
@ -245,7 +245,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 code:',$return_var);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
unset($v_stats_user);
|
||||
|
@ -262,15 +262,15 @@ $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 code:',$return_var);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
} else {
|
||||
if (!empty($v_ftp_email)) {
|
||||
$to = $_POST['v_ftp_email'];
|
||||
$subject = _("FTP login credentials");
|
||||
$subject = __("FTP login credentials");
|
||||
$hostname = exec('hostname');
|
||||
$from = _('MAIL_FROM',$hostname);
|
||||
$mailtext .= _('FTP_ACCOUNT_READY',$_POST['v_domain'],$user,$_POST['v_ftp_user'],$_POST['v_ftp_password']);
|
||||
$from = __('MAIL_FROM',$hostname);
|
||||
$mailtext .= __('FTP_ACCOUNT_READY',$_POST['v_domain'],$user,$_POST['v_ftp_user'],$_POST['v_ftp_password']);
|
||||
send_email($to, $subject, $mailtext, $from);
|
||||
//unset($v_ftp_email);
|
||||
}
|
||||
|
@ -285,7 +285,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 code:',$return_var);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
unset($output);
|
||||
|
@ -295,11 +295,11 @@ $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 code:',$return_var);
|
||||
if (empty($error)) $error = __('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
unset($output);
|
||||
$_SESSION['ok_msg'] = _('WEB_DOMAIN_CREATED_OK',$_POST[v_domain],$_POST[v_domain]);
|
||||
$_SESSION['ok_msg'] = __('WEB_DOMAIN_CREATED_OK',$_POST[v_domain],$_POST[v_domain]);
|
||||
unset($v_domain);
|
||||
unset($v_aliases);
|
||||
unset($v_ssl);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue