Skip to content

Commit f9c8e9e

Browse files
author
thom
committed
Remove / add protection on config change (#4048)
1 parent 213d96e commit f9c8e9e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

interface/web/admin/system_config_edit.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ function onUpdateSave($sql) {
157157

158158
$new_config = $app->tform->encode($this->dataRecord, $section);
159159
if($section == 'sites' && $new_config['client_protection'] != 'y' && $server_config_array['sites']['client_protection'] == 'y') {
160-
$app->db->query("UPDATE `web_domain` SET `sys_perm_group` = 'riud' WHERE `added_by` = 'admin'");
160+
$app->db->query("UPDATE `web_domain` SET `sys_userid` = (select `userid` FROM `sys_user` WHERE `default_group` = `web_domain`.`sys_groupid`), `sys_perm_group` = 'riud' WHERE `added_by` = 'admin'");
161161
} elseif($section == 'sites' && $new_config['client_protection'] != 'n' && $server_config_array['sites']['client_protection'] == 'n') {
162-
$app->db->query("UPDATE `web_domain` SET `sys_perm_group` = 'ru' WHERE `added_by` = 'admin'");
162+
$app->db->query("UPDATE `web_domain` SET `sys_userid` = 1, `sys_perm_group` = 'ru' WHERE `added_by` = 'admin'");
163163
}
164164
if($section == 'sites' && $new_config['vhost_subdomains'] != 'y' && $server_config_array['sites']['vhost_subdomains'] == 'y') {
165165
// check for existing vhost subdomains, if found the mode cannot be disabled

0 commit comments

Comments
 (0)