mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 10:37:42 -07:00
unified error msg variable
This commit is contained in:
parent
306907270e
commit
849d536993
7 changed files with 36 additions and 35 deletions
|
@ -26,14 +26,14 @@ if (!empty($_POST['udir'])) $udir = escapeshellarg(implode(",",$_POST['udir']));
|
|||
if ($action == 'restore') {
|
||||
exec (VESTA_CMD."v-schedule-user-restore ".$user." ".$backup." ".$web." ".$dns." ".$mail." ".$db." ".$cron." ".$udir, $output, $return_var);
|
||||
if ($return_var == 0) {
|
||||
$_SESSION['restore_msg'] = __('RESTORE_SCHEDULED');
|
||||
$_SESSION['error_msg'] = __('RESTORE_SCHEDULED');
|
||||
} else {
|
||||
$_SESSION['restore_msg'] = implode('<br>', $output);
|
||||
if (empty($_SESSION['restore_msg'])) {
|
||||
$_SESSION['restore_msg'] = __('Error: vesta did not return any output.');
|
||||
$_SESSION['error_msg'] = implode('<br>', $output);
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
$_SESSION['error_msg'] = __('Error: vesta did not return any output.');
|
||||
}
|
||||
if ($return_var == 4) {
|
||||
$_SESSION['restore_msg'] = __('RESTORE_EXISTS');
|
||||
$_SESSION['error_msg'] = __('RESTORE_EXISTS');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -213,23 +213,24 @@ function send_email($to,$subject,$mailtext,$from) {
|
|||
function display_error_block() {
|
||||
if (!empty($_SESSION['error_msg'])) {
|
||||
echo '
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$( "#dialog:ui-dialog" ).dialog( "destroy" );
|
||||
$( "#dialog-message" ).dialog({
|
||||
modal: true,
|
||||
buttons: {
|
||||
Ok: function() {
|
||||
$( this ).dialog( "close" );
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div id="dialog-message" title="Error">
|
||||
<p>';
|
||||
echo $_SESSION['error_msg'];
|
||||
echo "</p>\n </div>\n";
|
||||
<div>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$( "#dialog:ui-dialog" ).dialog( "destroy" );
|
||||
$( "#dialog-message" ).dialog({
|
||||
modal: true,
|
||||
buttons: {
|
||||
Ok: function() {
|
||||
$( this ).dialog( "close" );
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div id="dialog-message" title="">
|
||||
<p>'. $_SESSION['error_msg'] .'</p>
|
||||
</div>
|
||||
</div>'."\n";
|
||||
unset($_SESSION['error_msg']);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = __('SERVICE_ACTION_FAILED',__('restart'),$v_service);
|
||||
$_SESSION['error_srv'] = $error;
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
unset($output);
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
|||
if ($_SESSION['user'] == 'admin') {
|
||||
if (!empty($_GET['hostname'])) {
|
||||
exec (VESTA_CMD."v-restart-system yes", $output, $return_var);
|
||||
$_SESSION['error_srv'] = 'The system is going down for reboot NOW!';
|
||||
$_SESSION['error_msg'] = 'The system is going down for reboot NOW!';
|
||||
}
|
||||
unset($output);
|
||||
}
|
||||
|
|
|
@ -8,15 +8,15 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
|||
$v_username = escapeshellarg($user);
|
||||
exec (VESTA_CMD."v-schedule-user-backup ".$v_username, $output, $return_var);
|
||||
if ($return_var == 0) {
|
||||
$_SESSION['backup_msg'] = __('BACKUP_SCHEDULED');
|
||||
$_SESSION['error_msg'] = __('BACKUP_SCHEDULED');
|
||||
} else {
|
||||
$_SESSION['backup_msg'] = implode('<br>', $output);
|
||||
if (empty($_SESSION['backup_msg'])) {
|
||||
$_SESSION['backup_msg'] = __('Error: vesta did not return any output.');
|
||||
$_SESSION['error_msg'] = implode('<br>', $output);
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
$_SESSION['error_msg'] = __('Error: vesta did not return any output.');
|
||||
}
|
||||
|
||||
if ($return_var == 4) {
|
||||
$_SESSION['backup_msg'] = __('BACKUP_EXISTS');
|
||||
$_SESSION['error_msg'] = __('BACKUP_EXISTS');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -30,14 +30,14 @@ if (!empty($_GET['type'])) {
|
|||
|
||||
exec ($restore_cmd, $output, $return_var);
|
||||
if ($return_var == 0) {
|
||||
$_SESSION['restore_msg'] = __('RESTORE_SCHEDULED');
|
||||
$_SESSION['error_msg'] = __('RESTORE_SCHEDULED');
|
||||
} else {
|
||||
$_SESSION['restore_msg'] = implode('<br>', $output);
|
||||
if (empty($_SESSION['restore_msg'])) {
|
||||
$_SESSION['restore_msg'] = __('Error: vesta did not return any output.');
|
||||
$_SESSION['error_msg'] = implode('<br>', $output);
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
$_SESSION['error_msg'] = __('Error: vesta did not return any output.');
|
||||
}
|
||||
if ($return_var == 4) {
|
||||
$_SESSION['restore_msg'] = __('RESTORE_EXISTS');
|
||||
$_SESSION['error_msg'] = __('RESTORE_EXISTS');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ if ($_SESSION['user'] == 'admin') {
|
|||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = 'Error: '.$v_pkg.' update failed';
|
||||
$_SESSION['error_upd'] = $error;
|
||||
$_SESSION['error_msg'] = $error;
|
||||
}
|
||||
unset($output);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue