diff options
author | Daouda Lo <daouda@mandriva.com> | 2003-06-24 13:43:08 +0000 |
---|---|---|
committer | Daouda Lo <daouda@mandriva.com> | 2003-06-24 13:43:08 +0000 |
commit | 5aed49b3fe68109100005353a3fd09e8a2f8209b (patch) | |
tree | 6c596f5821bdf546f0ffe090622fe802d84bad3c | |
parent | 8b96f669803242b3dc71cadf8bafdb975d0358fb (diff) | |
download | userdrake-5aed49b3fe68109100005353a3fd09e8a2f8209b.tar userdrake-5aed49b3fe68109100005353a3fd09e8a2f8209b.tar.gz userdrake-5aed49b3fe68109100005353a3fd09e8a2f8209b.tar.bz2 userdrake-5aed49b3fe68109100005353a3fd09e8a2f8209b.tar.xz userdrake-5aed49b3fe68109100005353a3fd09e8a2f8209b.zip |
- check if group is empty before doing operation on it
-rwxr-xr-x | userdrake2 | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -78,7 +78,11 @@ my ($menu, $factory) = create_factory_menu($us->{wnd}{rwindow}, $checkall = $factory->get_widget("<main>" . N("/Options") . N("/Filter system users")); $checkedit = $factory->get_widget("<main>" . N("/Actions") . N("/Edit")); $checkdel = $factory->get_widget("<main>" . N("/Actions") . N("/Delete")); -$checkall->set_active($sysfilter); +if (defined $checkall) { + $checkall->set_active($sysfilter); +} else { + print STDERR "BUG with LANGUAGE $ENV{LANGUAGE}\n"; +} my $toolb = Gtk2::Toolbar->new; my $searchBox = Gtk2::HBox->new(0,5); $searchBox->pack_end(my $fbut = Gtk2::Button->new("Apply filter"), 0, 0, 4); @@ -138,16 +142,17 @@ sub NotebookSwitch { } sub RefreshUsersFull { my ($filterusers, $strfilt) = @_; - my $users = $ctx->UsersEnumerateFull(); + my ($users, $gid, $group, $groupnm); + $users = $ctx->UsersEnumerateFull(); $utree_model->clear(); my @UserReal; LOOP: foreach my $l (@$users) { next LOOP if ($filterusers && $l->Uid($GetValue) <= 499 || $l->Uid($GetValue) == 65534) ; push(@UserReal, $l) if $l->UserName($GetValue) =~ /^\Q$strfilt/; }; foreach my $l (@UserReal) { - my $a = $l->Gid($GetValue); my $group = $ctx->LookupGroupById($a); - $utree_model->append_set([ 0 => $l->UserName($GetValue), 1 => $l->Uid($GetValue), 2 => $group->GroupName($GetValue), 3 => $l->Gecos($GetValue), 4 => $l->LoginShell($GetValue), 5 => $l->HomeDir($GetValue) ]); + $a = $l->Gid($GetValue); $group = $ctx->LookupGroupById($a); $groupnm = ''; + $group and $groupnm = $group->GroupName($GetValue); + $utree_model->append_set([ 0 => $l->UserName($GetValue), 1 => $l->Uid($GetValue), 2 => $groupnm, 3 => $l->Gecos($GetValue), 4 => $l->LoginShell($GetValue), 5 => $l->HomeDir($GetValue) ]); } } - sub RefreshGroupsFull { my ($filtergroups, $strfilt) = @_; my $groups = $ctx->GroupsEnumerateFull(); |