{'group'}';
\$ENV{'USERADMIN_ACTION'} = 'MODIFY_GROUP';
EOF
);
$merr = &remote_foreign_call($serv->{'host'}, "useradmin",
"making_changes");
if (defined($merr)) {
print &text('usave_emaking', "$merr"),"\n";
print "\n";
next;
}
# Update the group on the server
print "$text{'gsave_update'}
\n";
&remote_foreign_call($serv->{'host'}, "useradmin", "modify_group",
\%ogroup, $group);
print "$text{'udel_done'}
\n";
# Make file changes
local @ulist;
if ($in{'servs'} || $host eq $hosts[0]) {
if ($group->{'gid'} != $ogroup{'gid'} && $in{'chgid'}) {
# Change GID on files if needed
if ($in{'chgid'} == 1) {
# Do all the home directories of users in
# this group
print "$text{'usave_gid'}
\n";
@ulist = &remote_foreign_call($serv->{'host'},
"useradmin", "list_users");
foreach $u (@ulist) {
if ($u->{'gid'} == $ogroup{'gid'} ||
&indexof($u->{'user'},@mems) >= 0) {
&remote_foreign_call(
$serv->{'host'},
"useradmin",
"recursive_change",
$u->{'home'},
-1, $ogroup{'gid'},
-1, $group->{'gid'});
}
}
print "$text{'udel_done'}
\n";
}
elsif ($in{'chgid'} == 2) {
# Do all files in this group from the root dir
print "$text{'usave_gid'}
\n";
&remote_foreign_call($serv->{'host'},
"useradmin", "recursive_change", "/",
-1, $ogroup{'gid'}, -1,$group->{'gid'});
print "$text{'udel_done'}
\n";
}
}
}
# Run the post-change command
&remote_foreign_call($serv->{'host'}, "useradmin", "made_changes");
if ($in{'others'}) {
if (&supports_gothers($serv)) {
# Update the group in other modules
print "$text{'usave_mothers'}
\n";
&remote_foreign_call($serv->{'host'}, "useradmin",
"other_modules", "useradmin_modify_group",
$group, \%ogroup);
print "$text{'udel_done'}
\n";
}
else {
# Group syncing not supported
print "$text{'gsave_nosync'}
\n";
}
}
# Update in local list
$host->{'groups'} = \@glist;
if (@ulist) {
$host->{'users'} = \@ulist;
}
&save_useradmin_host($host);
print "\n";
}
&webmin_log("modify", "group", $group->{'group'}, $group);
&ui_print_footer("", $text{'index_return'});