Serghey Rodin 12 лет назад
Родитель
Сommit
849d536993

+ 5 - 5
web/bulk/restore/index.php

@@ -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');
         }
     }
 }

+ 18 - 17
web/inc/main.php

@@ -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']);
     }
 }

+ 1 - 1
web/restart/service/index.php

@@ -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);
 }

+ 1 - 1
web/restart/system/index.php

@@ -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);
 }

+ 5 - 5
web/schedule/backup/index.php

@@ -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');
     }
 
 }

+ 5 - 5
web/schedule/restore/index.php

@@ -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');
     }
 }
 

+ 1 - 1
web/update/vesta/index.php

@@ -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);
 }