Skip to content

Commit 46e3b28

Browse files
author
Kristan Kenney
committed
Add POLICY_USER_EDIT_WEB_TEMPLATES system-wide switch
1 parent b6ada1d commit 46e3b28

File tree

4 files changed

+137
-109
lines changed

4 files changed

+137
-109
lines changed

bin/v-list-sys-config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ json_list() {
8282
"POLICY_SYSTEM_PASSWORD_RESET": "'$POLICY_SYSTEM_PASSWORD_RESET'",
8383
"POLICY_USER_VIEW_SUSPENDED": "'$POLICY_USER_VIEW_SUSPENDED'",
8484
"POLICY_USER_EDIT_DETAILS": "'$POLICY_USER_EDIT_DETAILS'",
85+
"POLICY_USER_EDIT_WEB_TEMPLATES": "'$POLICY_USER_EDIT_WEB_TEMPLATES'",
8586
"POLICY_USER_DELETE_LOGS": "'$POLICY_USER_DELETE_LOGS'",
8687
"POLICY_USER_VIEW_LOGS": "'$POLICY_USER_VIEW_LOGS'",
8788
"POLICY_USER_CHANGE_THEME": "'$POLICY_USER_CHANGE_THEME'"

web/edit/server/index.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,17 @@
706706
}
707707
}
708708

709+
// Change POLICY_USER_EDIT_DETAILS
710+
if (empty($_SESSION['error_msg'])) {
711+
if ($_POST['v_policy_user_edit_web_templates'] != $_SESSION['POLICY_USER_EDIT_WEB_TEMPLATES']) {
712+
exec (HESTIA_CMD."v-change-sys-config-value POLICY_USER_EDIT_WEB_TEMPLATES ".escapeshellarg($_POST['v_policy_user_edit_web_templates']), $output, $return_var);
713+
check_return_code($return_var,$output);
714+
unset($output);
715+
if (empty($_SESSION['error_msg'])) $v_policy_user_edit_details = $_POST['v_policy_user_edit_web_templates'];
716+
$v_security_adv = 'yes';
717+
}
718+
}
719+
709720
// Change POLICY_USER_VIEW_LOGS
710721
if (empty($_SESSION['error_msg'])) {
711722
if ($_POST['v_policy_user_view_logs'] != $_SESSION['POLICY_USER_VIEW_LOGS']) {

web/templates/pages/edit_server.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,6 +1120,20 @@
11201120
<br><br>
11211121
</td>
11221122
</tr>
1123+
<tr>
1124+
<td class="vst-text input-label">
1125+
<?php print _('Allow users to change web domain templates');?>
1126+
</td>
1127+
</tr>
1128+
<tr>
1129+
<td>
1130+
<select class="vst-list" name="v_policy_user_edit_web_templates">
1131+
<option value='yes' <?php if($_SESSION['POLICY_USER_EDIT_WEB_TEMPLATES'] !== 'no') echo 'selected' ?>><?php print _('yes'); ?></option>
1132+
<option value='no' <?php if($_SESSION['POLICY_USER_EDIT_WEB_TEMPLATES'] == 'no') echo 'selected' ?>><?php print _('no'); ?></option>
1133+
</select>
1134+
<br><br>
1135+
</td>
1136+
</tr>
11231137
<tr>
11241138
<td class="vst-text input-label">
11251139
<?php print _('Allow users to view action and login history logs');?>

0 commit comments

Comments
 (0)