Skip to content

Commit 849d536

Browse files
committed
unified error msg variable
1 parent 3069072 commit 849d536

File tree

7 files changed

+36
-35
lines changed

7 files changed

+36
-35
lines changed

web/bulk/restore/index.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@
2626
if ($action == 'restore') {
2727
exec (VESTA_CMD."v-schedule-user-restore ".$user." ".$backup." ".$web." ".$dns." ".$mail." ".$db." ".$cron." ".$udir, $output, $return_var);
2828
if ($return_var == 0) {
29-
$_SESSION['restore_msg'] = __('RESTORE_SCHEDULED');
29+
$_SESSION['error_msg'] = __('RESTORE_SCHEDULED');
3030
} else {
31-
$_SESSION['restore_msg'] = implode('<br>', $output);
32-
if (empty($_SESSION['restore_msg'])) {
33-
$_SESSION['restore_msg'] = __('Error: vesta did not return any output.');
31+
$_SESSION['error_msg'] = implode('<br>', $output);
32+
if (empty($_SESSION['error_msg'])) {
33+
$_SESSION['error_msg'] = __('Error: vesta did not return any output.');
3434
}
3535
if ($return_var == 4) {
36-
$_SESSION['restore_msg'] = __('RESTORE_EXISTS');
36+
$_SESSION['error_msg'] = __('RESTORE_EXISTS');
3737
}
3838
}
3939
}

web/inc/main.php

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -213,23 +213,24 @@ function send_email($to,$subject,$mailtext,$from) {
213213
function display_error_block() {
214214
if (!empty($_SESSION['error_msg'])) {
215215
echo '
216-
<script type="text/javascript">
217-
$(function() {
218-
$( "#dialog:ui-dialog" ).dialog( "destroy" );
219-
$( "#dialog-message" ).dialog({
220-
modal: true,
221-
buttons: {
222-
Ok: function() {
223-
$( this ).dialog( "close" );
224-
}
225-
}
226-
});
227-
});
228-
</script>
229-
<div id="dialog-message" title="Error">
230-
<p>';
231-
echo $_SESSION['error_msg'];
232-
echo "</p>\n </div>\n";
216+
<div>
217+
<script type="text/javascript">
218+
$(function() {
219+
$( "#dialog:ui-dialog" ).dialog( "destroy" );
220+
$( "#dialog-message" ).dialog({
221+
modal: true,
222+
buttons: {
223+
Ok: function() {
224+
$( this ).dialog( "close" );
225+
}
226+
}
227+
});
228+
});
229+
</script>
230+
<div id="dialog-message" title="">
231+
<p>'. $_SESSION['error_msg'] .'</p>
232+
</div>
233+
</div>'."\n";
233234
unset($_SESSION['error_msg']);
234235
}
235236
}

web/restart/service/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
if ($return_var != 0) {
1414
$error = implode('<br>', $output);
1515
if (empty($error)) $error = __('SERVICE_ACTION_FAILED',__('restart'),$v_service);
16-
$_SESSION['error_srv'] = $error;
16+
$_SESSION['error_msg'] = $error;
1717
}
1818
unset($output);
1919
}

web/restart/system/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
if ($_SESSION['user'] == 'admin') {
99
if (!empty($_GET['hostname'])) {
1010
exec (VESTA_CMD."v-restart-system yes", $output, $return_var);
11-
$_SESSION['error_srv'] = 'The system is going down for reboot NOW!';
11+
$_SESSION['error_msg'] = 'The system is going down for reboot NOW!';
1212
}
1313
unset($output);
1414
}

web/schedule/backup/index.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
$v_username = escapeshellarg($user);
99
exec (VESTA_CMD."v-schedule-user-backup ".$v_username, $output, $return_var);
1010
if ($return_var == 0) {
11-
$_SESSION['backup_msg'] = __('BACKUP_SCHEDULED');
11+
$_SESSION['error_msg'] = __('BACKUP_SCHEDULED');
1212
} else {
13-
$_SESSION['backup_msg'] = implode('<br>', $output);
14-
if (empty($_SESSION['backup_msg'])) {
15-
$_SESSION['backup_msg'] = __('Error: vesta did not return any output.');
13+
$_SESSION['error_msg'] = implode('<br>', $output);
14+
if (empty($_SESSION['error_msg'])) {
15+
$_SESSION['error_msg'] = __('Error: vesta did not return any output.');
1616
}
1717

1818
if ($return_var == 4) {
19-
$_SESSION['backup_msg'] = __('BACKUP_EXISTS');
19+
$_SESSION['error_msg'] = __('BACKUP_EXISTS');
2020
}
2121

2222
}

web/schedule/restore/index.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@
3030

3131
exec ($restore_cmd, $output, $return_var);
3232
if ($return_var == 0) {
33-
$_SESSION['restore_msg'] = __('RESTORE_SCHEDULED');
33+
$_SESSION['error_msg'] = __('RESTORE_SCHEDULED');
3434
} else {
35-
$_SESSION['restore_msg'] = implode('<br>', $output);
36-
if (empty($_SESSION['restore_msg'])) {
37-
$_SESSION['restore_msg'] = __('Error: vesta did not return any output.');
35+
$_SESSION['error_msg'] = implode('<br>', $output);
36+
if (empty($_SESSION['error_msg'])) {
37+
$_SESSION['error_msg'] = __('Error: vesta did not return any output.');
3838
}
3939
if ($return_var == 4) {
40-
$_SESSION['restore_msg'] = __('RESTORE_EXISTS');
40+
$_SESSION['error_msg'] = __('RESTORE_EXISTS');
4141
}
4242
}
4343

web/update/vesta/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
if ($return_var != 0) {
1515
$error = implode('<br>', $output);
1616
if (empty($error)) $error = 'Error: '.$v_pkg.' update failed';
17-
$_SESSION['error_upd'] = $error;
17+
$_SESSION['error_msg'] = $error;
1818
}
1919
unset($output);
2020
}

0 commit comments

Comments
 (0)