Skip to content

Commit ec4d22f

Browse files
author
Kristan Kenney
committed
[Web UI] Add controls to enable/disable File Manager
Allow user to enable/disable File Manager directly from within the control panel web interface.
1 parent 8c3d792 commit ec4d22f

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed

web/edit/server/index.php

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,29 @@
254254
}
255255
}
256256

257+
// Set File Manager support
258+
if (empty($_SESSION['error_msg'])) {
259+
if ((!empty($_POST['v_filemanager'])) && ($_SESSION['FILE_MANAGER'] != $_POST['v_filemanager'])) {
260+
if ($_POST['v_filemanager'] == 'yes') {
261+
$_POST['v_filemanager'] == 'true';
262+
exec (HESTIA_CMD."v-add-sys-filemanager", $output, $return_var);
263+
check_return_code($return_var,$output);
264+
unset($output);
265+
if (empty($_SESSION['error_msg'])) $_SESSION['FILE_MANAGER'] = 'yes';
266+
} else {
267+
$_POST['v_filemanager'] == 'false';
268+
exec (HESTIA_CMD."v-delete-sys-filemanager", $output, $return_var);
269+
check_return_code($return_var,$output);
270+
unset($output);
271+
if (empty($_SESSION['error_msg'])) $_SESSION['FILE_MANAGER'] = 'no';
272+
}
273+
}
274+
}
275+
257276
// Set disk_quota support
258277
if (empty($_SESSION['error_msg'])) {
259278
if ((!empty($_POST['v_quota'])) && ($_SESSION['DISK_QUOTA'] != $_POST['v_quota'])) {
260-
if($_POST['v_quota'] == 'yes') {
279+
if ($_POST['v_quota'] == 'yes') {
261280
exec (HESTIA_CMD."v-add-sys-quota", $output, $return_var);
262281
check_return_code($return_var,$output);
263282
unset($output);
@@ -276,7 +295,7 @@
276295
if ($_SESSION['FIREWALL_SYSTEM'] == 'iptables') $v_firewall = 'yes';
277296
if ($_SESSION['FIREWALL_SYSTEM'] != 'iptables') $v_firewall = 'no';
278297
if ((!empty($_POST['v_firewall'])) && ($v_firewall != $_POST['v_firewall'])) {
279-
if($_POST['v_firewall'] == 'yes') {
298+
if ($_POST['v_firewall'] == 'yes') {
280299
exec (HESTIA_CMD."v-add-sys-firewall", $output, $return_var);
281300
check_return_code($return_var,$output);
282301
unset($output);

web/templates/admin/edit_server.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,20 @@
820820
<tr>
821821
<td class="vst-text input-label step-left">
822822
<table style="display:<?php if (empty($v_adv)) echo 'none';?> ;" id="hestia">
823+
<tr>
824+
<td class="vst-text">
825+
<?php print __('Fm');?>
826+
</td>
827+
</tr>
828+
<tr>
829+
<td>
830+
<select class="vst-list" name="v_filemanager">
831+
<option value='no'><?php print __('no'); ?></option>
832+
<option value='yes' <?php if($_SESSION['FILE_MANAGER'] == 'true') echo 'selected' ?> ><?php print __('yes'); ?></option>
833+
</select>
834+
<br><br>
835+
</td>
836+
</tr>
823837
<tr>
824838
<td class="vst-text">
825839
<?php print __('FileSystem Disk Quota');?>

0 commit comments

Comments
 (0)