Skip to content

Commit b603425

Browse files
author
Kristan Kenney
committed
Update theme option
1 parent 64d1b33 commit b603425

File tree

3 files changed

+16
-21
lines changed

3 files changed

+16
-21
lines changed

web/edit/server/index.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -752,12 +752,13 @@
752752

753753
// Change POLICY_USER_CHANGE_THEME
754754
if (empty($_SESSION['error_msg'])) {
755-
if ($_POST['v_policy_user_change_theme'] != $_SESSION['POLICY_USER_CHANGE_THEME']) {
756-
exec (HESTIA_CMD."v-change-sys-config-value POLICY_USER_CHANGE_THEME ".escapeshellarg($_POST['v_policy_user_change_theme']), $output, $return_var);
757-
check_return_code($return_var,$output);
758-
unset($output);
759-
if (empty($_SESSION['error_msg'])) $v_policy_user_change_theme = $_POST['v_policy_user_change_theme'];
760-
$v_security_adv = 'yes';
755+
if ($_POST['v_policy_user_change_theme'] == 'on') { $_POST['v_policy_user_change_theme'] = 'no'; } else { $_POST['v_policy_user_change_theme'] = 'yes'; } {
756+
if ($_POST['v_policy_user_change_theme'] != $_SESSION['POLICY_USER_CHANGE_THEME']) {
757+
exec (HESTIA_CMD."v-change-sys-config-value POLICY_USER_CHANGE_THEME ".escapeshellarg($_POST['v_policy_user_change_theme']), $output, $return_var);
758+
check_return_code($return_var,$output);
759+
unset($output);
760+
if (empty($_SESSION['error_msg'])) $v_policy_user_change_theme = $_POST['v_policy_user_change_theme'];
761+
}
761762
}
762763
}
763764

web/templates/admin/edit_server.html

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,15 @@
118118
}
119119
?>
120120
</select>
121-
<br><br>
122121
</td>
123122
</tr>
124123
<tr>
125124
<td class="vst-text input-label">
125+
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_policy_user_change_theme" <?php if ((isset($_SESSION['POLICY_USER_CHANGE_THEME'])) && (!empty($_SESSION['POLICY_USER_CHANGE_THEME'])) && ($_SESSION['POLICY_USER_CHANGE_THEME'] == "no")) echo "checked=yes" ?>><?php print _('Set as selected theme for all users');?></label>
126+
</td>
127+
</tr>
128+
<tr>
129+
<td class="vst-text input-label step-top">
126130
<?php print _('Default Language');?>
127131
</td>
128132
</tr>
@@ -1181,20 +1185,6 @@
11811185
<br><br>
11821186
</td>
11831187
</tr>
1184-
<tr>
1185-
<td class="vst-text input-label">
1186-
<?php print _('Allow users to change user interface theme');?>
1187-
</td>
1188-
</tr>
1189-
<tr>
1190-
<td>
1191-
<select class="vst-list" name="v_policy_user_change_theme">
1192-
<option value='yes' <?php if($_SESSION['POLICY_USER_CHANGE_THEME'] !== 'no') echo 'selected' ?>><?php print _('yes'); ?></option>
1193-
<option value='no' <?php if($_SESSION['POLICY_USER_CHANGE_THEME'] == 'no') echo 'selected' ?>><?php print _('no'); ?></option>
1194-
</select>
1195-
<br><br>
1196-
</td>
1197-
</tr>
11981188
<tr>
11991189
<td class="vst-text input-label step-top" style="font-size:1rem;padding-bottom:12px;">
12001190
<?=_('Domains');?>

web/templates/admin/list_stats.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,16 @@
2828
<option value=""><?=_('show per user')?></option>
2929
<?
3030
foreach ($users as $key => $value) {
31+
if (($_SESSION['POLICY_SYSTEM_HIDE_ADMIN'] === 'yes') && ($value === 'admin')) {
32+
33+
} else {
3134
echo "\t\t\t\t<option value=\"".$value."\"";
3235
if ((!empty($v_user)) && ( $value == $_GET['user'])){
3336
echo ' selected';
3437
}
3538
echo ">".$value."</option>\n";
3639
}
40+
}
3741
?>
3842
</select>
3943
</div>

0 commit comments

Comments
 (0)