Skip to content

Commit be9a3a9

Browse files
author
Kristan Kenney
committed
Add system policy key
1 parent 6828a39 commit be9a3a9

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

bin/v-list-sys-config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ json_list() {
7676
"API": "'$API'",
7777
"API_ALLOWED_IP": "'$API_ALLOWED_IP'",
7878
"UPDATE_AVAILABLE": "'$UPDATE_AVAILABLE'",
79+
"POLICY_SYSTEM_ENABLE_JETSKIS": "'$POLICY_SYSTEM_ENABLE_JETSKIS'",
7980
"POLICY_SYSTEM_PROTECTED_ADMIN": "'$POLICY_SYSTEM_PROTECTED_ADMIN'",
8081
"POLICY_SYSTEM_HIDE_ADMIN": "'$POLICY_SYSTEM_HIDE_ADMIN'",
8182
"POLICY_SYSTEM_HIDE_SERVICES": "'$POLICY_SYSTEM_HIDE_SERVICES'",

web/edit/server/index.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,17 @@
288288
}
289289
}
290290

291+
// Update experimental features status
292+
if (empty($_SESSION['error_msg'])) {
293+
if ($_POST['v_experimental_features'] != $_SESSION['POLICY_SYSTEM_ENABLE_JETSKIS']) {
294+
if ($_POST['v_experimental_features'] == 'on') { $_POST['v_experimental_features'] = 'true'; } else { $_POST['v_experimental_features'] = 'false'; }
295+
exec (HESTIA_CMD."v-change-sys-config-value POLICY_SYSTEM_ENABLE_JETSKIS ".escapeshellarg($_POST['v_experimental_features']), $output, $return_var);
296+
check_return_code($return_var,$output);
297+
unset($output);
298+
$v_debug_mode_adv = 'yes';
299+
}
300+
}
301+
291302
// Set File Manager support
292303
if (empty($_SESSION['error_msg'])) {
293304
if ((!empty($_POST['v_filemanager'])) && ($_SESSION['FILE_MANAGER'] != $_POST['v_filemanager'])) {

web/templates/pages/edit_server.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@
154154

155155
</td>
156156
</tr>
157+
<tr>
158+
<td>
159+
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_experimental_features" <?php if ((isset($_SESSION['POLICY_SYSTEM_ENABLE_JETSKIS'])) && (!empty($_SESSION['POLICY_SYSTEM_ENABLE_JETSKIS'])) && ($_SESSION['POLICY_SYSTEM_ENABLE_JETSKIS'] == "true")) echo "checked=yes" ?>><?php print _('Enable preview features');?></label>
160+
</td>
161+
</tr>
157162
<?php if ($_SESSION['RELEASE_BRANCH'] != "release") { ?>
158163
<tr>
159164
<td>
@@ -476,6 +481,7 @@
476481
<br><br>
477482
</td>
478483
</tr>
484+
<? if ($_SESSION['POLICY_SYSTEM_ENABLE_JETSKIS'] === 'true') {?>
479485
<tr>
480486
<td class="vst-text">
481487
<?php print _('phpMyAdmin Single Sign On') ?>
@@ -491,6 +497,7 @@
491497
<br />
492498
</td>
493499
</tr>
500+
<? } ?>
494501
<?php } ?>
495502
<?php if ($v_mysql == 'yes') {
496503
$i = 0;
@@ -1092,6 +1099,7 @@
10921099
</td>
10931100

10941101
</tr>
1102+
<? if ($_SESSION['POLICY_SYSTEM_ENABLE_JETSKIS'] === 'true') { ?>
10951103
<tr>
10961104
<td class="vst-text input-label">
10971105
<?php print _('Allow suspended users to log in with read-only access');?>
@@ -1106,6 +1114,7 @@
11061114
<br><br>
11071115
</td>
11081116
</tr>
1117+
<? } ?>
11091118
<tr>
11101119
<td class="vst-text input-label">
11111120
<?php print _('Allow users to edit their account details');?>

0 commit comments

Comments
 (0)