diff options
-rwxr-xr-x | userdrake | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -531,9 +531,13 @@ sub Delete { UpdateOrDelUsersInGroup($username, 1); #Let's check out the user's primary group my $usergid = $userEnt->Gid($GetValue); - my $groupEnt = $ctx->LookupGroupById($usergid); - my $member = $groupEnt->MemberName(1, 0); - if ($groupEnt && scalar(@$member) == 0) { $groupEnt->Gid($GetValue) > 499 and $ctx->GroupDel($groupEnt) }; + my $groupEnt = $ctx->LookupGroupById($usergid); + if ($groupEnt) { + my $member = $groupEnt->MemberName(1, 0); + if (scalar(@$member) == 0 and $groupEnt->Gid($GetValue) > 499) { + $ctx->GroupDel($groupEnt) + } + } $checkhome->get_active and $ctx->CleanHome($userEnt); $checkspool->get_active and $ctx->CleanSpool($userEnt); Refresh($sysfilter, $stringsearch) |