Prechádzať zdrojové kódy

Merge pull request #1126 from hestiacp/fix/2020-09-fix_saving_filemanager_no

Fix issue when Filemanager is "no" and saving "edit server"
Raphael Schneeberger 5 rokov pred
rodič
commit
f6e66f2c2d

+ 3 - 5
web/edit/server/index.php

@@ -257,18 +257,16 @@ if (!empty($_POST['save'])) {
    // Set File Manager support
    // Set File Manager support
     if (empty($_SESSION['error_msg'])) {
     if (empty($_SESSION['error_msg'])) {
         if ((!empty($_POST['v_filemanager'])) && ($_SESSION['FILE_MANAGER'] != $_POST['v_filemanager'])) {
         if ((!empty($_POST['v_filemanager'])) && ($_SESSION['FILE_MANAGER'] != $_POST['v_filemanager'])) {
-            if ($_POST['v_filemanager'] == 'yes') {
-                $_POST['v_filemanager'] == 'true';
+            if ($_POST['v_filemanager'] == 'true') {
                 exec (HESTIA_CMD."v-add-sys-filemanager", $output, $return_var);
                 exec (HESTIA_CMD."v-add-sys-filemanager", $output, $return_var);
                 check_return_code($return_var,$output);
                 check_return_code($return_var,$output);
                 unset($output);
                 unset($output);
-                if (empty($_SESSION['error_msg'])) $_SESSION['FILE_MANAGER'] = 'yes';
+                if (empty($_SESSION['error_msg'])) $_SESSION['FILE_MANAGER'] = 'true';
             } else {
             } else {
-                $_POST['v_filemanager'] == 'false';
                 exec (HESTIA_CMD."v-delete-sys-filemanager", $output, $return_var);
                 exec (HESTIA_CMD."v-delete-sys-filemanager", $output, $return_var);
                 check_return_code($return_var,$output);
                 check_return_code($return_var,$output);
                 unset($output);
                 unset($output);
-                if (empty($_SESSION['error_msg'])) $_SESSION['FILE_MANAGER'] = 'no';
+                if (empty($_SESSION['error_msg'])) $_SESSION['FILE_MANAGER'] = 'false';
             }
             }
         }
         }
     }
     }

+ 3 - 3
web/templates/admin/edit_server.html

@@ -842,14 +842,14 @@
                                     <table style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="hestia">
                                     <table style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="hestia">
                                         <tr>
                                         <tr>
                                             <td class="vst-text input-label">
                                             <td class="vst-text input-label">
-                                                <?php print __('Fm');?>
+                                                <?php print __('Filemanager');?>
                                             </td>
                                             </td>
                                         </tr>
                                         </tr>
                                         <tr>
                                         <tr>
                                             <td>
                                             <td>
                                                 <select class="vst-list" name="v_filemanager">
                                                 <select class="vst-list" name="v_filemanager">
-                                                    <option value='no'><?php print __('no'); ?></option>
-                                                    <option value='yes' <?php if($_SESSION['FILE_MANAGER'] == 'true') echo 'selected' ?> ><?php print __('yes'); ?></option>
+                                                    <option value='false'><?php print __('no'); ?></option>
+                                                    <option value='true' <?php if($_SESSION['FILE_MANAGER'] == 'true') echo 'selected' ?> ><?php print __('yes'); ?></option>
                                                 </select>
                                                 </select>
                                                 <br><br>
                                                 <br><br>
                                             </td>
                                             </td>