aboutsummaryrefslogtreecommitdiffstats
path: root/userdrake2
diff options
context:
space:
mode:
authorDaouda Lo <daouda@mandriva.com>2003-06-24 13:43:08 +0000
committerDaouda Lo <daouda@mandriva.com>2003-06-24 13:43:08 +0000
commit5aed49b3fe68109100005353a3fd09e8a2f8209b (patch)
tree6c596f5821bdf546f0ffe090622fe802d84bad3c /userdrake2
parent8b96f669803242b3dc71cadf8bafdb975d0358fb (diff)
downloaduserdrake-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
Diffstat (limited to 'userdrake2')
-rwxr-xr-xuserdrake215
1 files changed, 10 insertions, 5 deletions
diff --git a/userdrake2 b/userdrake2
index 07fd0b2..10e3764 100755
--- a/userdrake2
+++ b/userdrake2
@@ -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();