mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 18:49:21 -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
|
@ -10,8 +10,6 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
|||
// Header
|
||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
|
||||
|
||||
// Panel
|
||||
top_panel($user,$TAB);
|
||||
|
||||
$lang = 'ru_RU.utf8';
|
||||
setlocale(LC_ALL, $lang);
|
||||
|
@ -30,7 +28,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
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: 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);
|
||||
|
@ -86,7 +84,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
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: vesta did not return any output.');
|
||||
if (empty($error)) $error = _('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
$v_password = "••••••••";
|
||||
|
@ -99,7 +97,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
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: vesta did not return any output.');
|
||||
if (empty($error)) $error = _('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
unset($output);
|
||||
|
@ -111,8 +109,10 @@ if ($_SESSION['user'] == 'admin') {
|
|||
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: vesta did not return any output.');
|
||||
if (empty($error)) $error = _('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
} else {
|
||||
if ($_GET['user'] == 'admin') $_SESSION['language'] = $_POST['v_language'];
|
||||
}
|
||||
unset($output);
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
exec (VESTA_CMD."v-change-user-template ".$v_username." ".$v_template, $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);
|
||||
|
@ -135,7 +135,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
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: vesta did not return any output.');
|
||||
if (empty($error)) $error = _('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
unset($output);
|
||||
|
@ -151,7 +151,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
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: vesta did not return any output.');
|
||||
if (empty($error)) $error = _('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
}
|
||||
|
@ -165,7 +165,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
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: vesta did not return any output.');
|
||||
if (empty($error)) $error = _('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
unset($output);
|
||||
|
@ -183,16 +183,19 @@ if ($_SESSION['user'] == 'admin') {
|
|||
exec ($ns_cmd, $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.');
|
||||
}
|
||||
}
|
||||
// Panel
|
||||
top_panel($user,$TAB);
|
||||
|
||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_user.html');
|
||||
unset($_SESSION['error_msg']);
|
||||
unset($_SESSION['ok_msg']);
|
||||
|
@ -208,7 +211,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
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: 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);
|
||||
|
@ -250,7 +253,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
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: vesta did not return any output.');
|
||||
if (empty($error)) $error = _('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
$v_password = "••••••••";
|
||||
|
@ -263,8 +266,10 @@ if ($_SESSION['user'] == 'admin') {
|
|||
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: vesta did not return any output.');
|
||||
if (empty($error)) $error = _('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
} else {
|
||||
$_SESSION['language'] = $_POST['v_language'];
|
||||
}
|
||||
unset($output);
|
||||
}
|
||||
|
@ -275,7 +280,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
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: vesta did not return any output.');
|
||||
if (empty($error)) $error = _('Error code:',$return_var);
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
unset($output);
|
||||
|
@ -293,16 +298,19 @@ if ($_SESSION['user'] == 'admin') {
|
|||
exec ($ns_cmd, $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.');
|
||||
}
|
||||
}
|
||||
// Panel
|
||||
top_panel($user,$TAB);
|
||||
|
||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/user/edit_user.html');
|
||||
unset($_SESSION['error_msg']);
|
||||
unset($_SESSION['ok_msg']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue