Added warning requiring reboot if group scope is changed
This commit is contained in:
Steve Beaver 2018-06-27 10:53:04 -04:00
parent 6f8e648f5c
commit 64fa420718
2 changed files with 11 additions and 3 deletions

View File

@ -880,11 +880,18 @@ function local_group_set($group, $reset = false) {
$group_name = $group['name'];
$group_gid = $group['gid'];
$group_members = '';
if (!$reset && !empty($group['member']) && count($group['member']) > 0) {
$group_members = implode(",", $group['member']);
}
if (empty($group_name) || $group['scope'] == "remote") {
if (empty($group_name)) {
return;
}
// If the group is now remote, make sure there is no local group with the same name
if ($group['scope'] == "remote") {
local_group_del($group);
return;
}
@ -904,8 +911,8 @@ function local_group_set($group, $reset = false) {
if ($debug) {
log_error(sprintf(gettext("Running: %s"), $cmd));
}
mwexec($cmd);
mwexec($cmd);
}
function local_group_del($group) {

View File

@ -423,7 +423,8 @@ if ($pconfig['gtype'] == "system") {
'*Scope',
$pconfig['gtype'],
["local" => gettext("Local"), "remote" => gettext("Remote")]
));
))->setHelp("<span class=\"text-danger\">Warning: Changing this setting may affect the local groups file, " .
"in which case a reboot may be required for the changes to take effect.</span>");
}
$section->addInput(new Form_Input(