Skip to content

Commit 312d092

Browse files
author
Kristan Kenney
committed
Add POLICY_USER_EDIT_DNS_TEMPLATES
1 parent 1d06a26 commit 312d092

File tree

5 files changed

+32
-2
lines changed

5 files changed

+32
-2
lines changed

bin/v-list-sys-config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ json_list() {
8383
"POLICY_USER_VIEW_SUSPENDED": "'$POLICY_USER_VIEW_SUSPENDED'",
8484
"POLICY_USER_EDIT_DETAILS": "'$POLICY_USER_EDIT_DETAILS'",
8585
"POLICY_USER_EDIT_WEB_TEMPLATES": "'$POLICY_USER_EDIT_WEB_TEMPLATES'",
86+
"POLICY_USER_EDIT_DNS_TEMPLATES": "'$POLICY_USER_EDIT_DNS_TEMPLATES'",
8687
"POLICY_USER_DELETE_LOGS": "'$POLICY_USER_DELETE_LOGS'",
8788
"POLICY_USER_VIEW_LOGS": "'$POLICY_USER_VIEW_LOGS'",
8889
"POLICY_USER_CHANGE_THEME": "'$POLICY_USER_CHANGE_THEME'"

web/edit/server/index.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@
706706
}
707707
}
708708

709-
// Change POLICY_USER_EDIT_DETAILS
709+
// Change POLICY_USER_EDIT_WEB_TEMPLATES
710710
if (empty($_SESSION['error_msg'])) {
711711
if ($_POST['v_policy_user_edit_web_templates'] != $_SESSION['POLICY_USER_EDIT_WEB_TEMPLATES']) {
712712
exec (HESTIA_CMD."v-change-sys-config-value POLICY_USER_EDIT_WEB_TEMPLATES ".escapeshellarg($_POST['v_policy_user_edit_web_templates']), $output, $return_var);
@@ -717,6 +717,17 @@
717717
}
718718
}
719719

720+
// Change POLICY_USER_EDIT_DNS_TEMPLATES
721+
if (empty($_SESSION['error_msg'])) {
722+
if ($_POST['v_policy_user_edit_dns_templates'] != $_SESSION['POLICY_USER_EDIT_DNS_TEMPLATES']) {
723+
exec (HESTIA_CMD."v-change-sys-config-value POLICY_USER_EDIT_DNS_TEMPLATES ".escapeshellarg($_POST['v_policy_user_edit_dns_templates']), $output, $return_var);
724+
check_return_code($return_var,$output);
725+
unset($output);
726+
if (empty($_SESSION['error_msg'])) $v_policy_user_edit_details = $_POST['v_policy_user_edit_dns_templates'];
727+
$v_security_adv = 'yes';
728+
}
729+
}
730+
720731
// Change POLICY_USER_VIEW_LOGS
721732
if (empty($_SESSION['error_msg'])) {
722733
if ($_POST['v_policy_user_view_logs'] != $_SESSION['POLICY_USER_VIEW_LOGS']) {

web/templates/pages/add_dns.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
<input type="text" size="20" class="vst-input vst-list-editor" name="v_ip" value="<?=htmlentities(trim($v_ip, "'"))?>">
100100
</td>
101101
</tr>
102+
<? if (($_SESSION['userContext'] === 'admin') || ($_SESSION['userContext'] === 'user') && ($_SESSION['POLICY_USER_EDIT_DNS_TEMPLATES'] === 'yes')) { ?>
102103
<tr>
103104
<td class="vst-text input-label">
104105
<?php print _('Template') . "<span class='optional'>" . strtoupper($_SESSION['DNS_SYSTEM']) . "</span>";?>
@@ -120,6 +121,7 @@
120121
</select>
121122
</td>
122123
</tr>
124+
<? } ?>
123125
<tr>
124126
<td class="vst-text input-label step-top">
125127
<a href="javascript:elementHideShow('advtable');" class="vst-advanced"><?php print _('Advanced options');?></a>

web/templates/pages/edit_dns.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
<input type="text" size="20" class="vst-input vst-list-editor" name="v_ip" value="<?=htmlentities(trim($v_ip, "'"))?>">
8585
</td>
8686
</tr>
87+
<? if (($_SESSION['userContext'] === 'admin') || ($_SESSION['userContext'] === 'user') && ($_SESSION['POLICY_USER_EDIT_DNS_TEMPLATES'] === 'yes')) { ?>
8788
<tr>
8889
<td class="vst-text input-label">
8990
<?php print _('Template') . "<span class='optional'>" . strtoupper($_SESSION['DNS_SYSTEM']) . "</span>";?>
@@ -105,6 +106,7 @@
105106
</select>
106107
</td>
107108
</tr>
109+
<? } ?>
108110
<tr>
109111
<td class="vst-text input-label">
110112
<?php print _('Expiration Date');?><span class="optional">(<?=_('YYYY-MM-DD');?>)</span>

web/templates/pages/edit_server.html

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,7 @@
11221122
</tr>
11231123
<tr>
11241124
<td class="vst-text input-label">
1125-
<?php print _('Allow users to change web domain templates');?>
1125+
<?php print _('Allow users to change templates when editing web domains');?>
11261126
</td>
11271127
</tr>
11281128
<tr>
@@ -1134,6 +1134,20 @@
11341134
<br><br>
11351135
</td>
11361136
</tr>
1137+
<tr>
1138+
<td class="vst-text input-label">
1139+
<?php print _('Allow users to change templates when editing DNS zones');?>
1140+
</td>
1141+
</tr>
1142+
<tr>
1143+
<td>
1144+
<select class="vst-list" name="v_policy_user_edit_web_templates">
1145+
<option value='yes' <?php if($_SESSION['POLICY_USER_EDIT_DNS_TEMPLATES'] !== 'no') echo 'selected' ?>><?php print _('yes'); ?></option>
1146+
<option value='no' <?php if($_SESSION['POLICY_USER_EDIT_DNS_TEMPLATES'] == 'no') echo 'selected' ?>><?php print _('no'); ?></option>
1147+
</select>
1148+
<br><br>
1149+
</td>
1150+
</tr>
11371151
<tr>
11381152
<td class="vst-text input-label">
11391153
<?php print _('Allow users to view action and login history logs');?>

0 commit comments

Comments
 (0)