Fixed a bug that caused an empty shell to appear in the shells list for new users.
Fixed the hashing format for Blowfish passwords, to put $2a$ at the start instead of $2$.
On Linux systems with SElinux enabled, the context user_u:object_r:user_home_dir_t is set on new home directories by default.
+---- Changes since 1.510 ----
+When deleting a user's personal group and user deletion in other modules is enabled, delete the group in other modules too.
push(@secs, $g->{'gid'});
}
}
+
+ # Go ahead and do it!
&set_user_envs($user, 'DELETE_USER', undef, \@secs);
$merr = &making_changes();
&error(&text('usave_emaking', "<tt>$merr</tt>")) if (defined($merr));
- # Go ahead and do it!
+ # Delete in other modules first
$in{'others'} = !$access{'dothers'} if ($access{'dothers'} != 1);
if ($in{'others'}) {
print "$text{'udel_other'}<br>\n";
}
}
+ # Delete the user
print "$text{'udel_pass'}<br>\n";
&delete_user($user);
print "$text{'udel_done'}<p>\n";
+ # Delete the user from other groups
print "$text{'udel_groups'}<br>\n";
foreach $g (&list_groups()) {
@mems = split(/,/, $g->{'members'});
}
print "$text{'udel_done'}<p>\n";
+ # Delete the user's personal group, if it has no other members
if ($mygroup && !$mygroup->{'members'}) {
local $another;
foreach $ou (&list_users()) {
$another = $ou if ($ou->{'gid'} == $mygroup->{'gid'});
}
+ if (!$another && $in{'others'}) {
+ print "$text{'udel_ugroupother'}<br>\n";
+ local $error_must_die = 1;
+ eval { &other_modules("useradmin_delete_group",
+ $mygroup); };
+ if ($@) {
+ print &text('udel_failed', $@),"<p>\n";
+ }
+ else {
+ print "$text{'gdel_done'}<p>\n";
+ }
+ }
if (!$another) {
print "$text{'udel_ugroup'}<br>\n";
&delete_group($mygroup);
}
&unlock_user_files();
- if ($in{'delhome'} && $user->{'home'} !~ /^\/+$/ && $access{'delhome'} != 0) {
+ if ($in{'delhome'} && $user->{'home'} !~ /^\/+$/ &&
+ $access{'delhome'} != 0) {
# Delete home directory
print "$text{'udel_home'}<br>\n";
&lock_file($user->{'home'});
udel_other=Deleting from other modules ..
udel_pass=Deleting password file entry ..
udel_groups=Removing from groups ..
+udel_ugroupother=Deleting this user's group in other modules ..
udel_ugroup=Deleting this user's group ..
udel_home=Deleting home directory ..
udel_done=.. done