diff options
author | Daouda Lo <daouda@mandriva.com> | 2003-07-02 13:44:34 +0000 |
---|---|---|
committer | Daouda Lo <daouda@mandriva.com> | 2003-07-02 13:44:34 +0000 |
commit | 9d28bdae4fd6ac0969b6daaddb47cecebf50aae9 (patch) | |
tree | 986d8d7b6e1c2bc77183d52387ba487ac6e3d81f | |
parent | f2b3534323c1a696f61cd16ad59c9dfb498f6d33 (diff) | |
download | userdrake-9d28bdae4fd6ac0969b6daaddb47cecebf50aae9.tar userdrake-9d28bdae4fd6ac0969b6daaddb47cecebf50aae9.tar.gz userdrake-9d28bdae4fd6ac0969b6daaddb47cecebf50aae9.tar.bz2 userdrake-9d28bdae4fd6ac0969b6daaddb47cecebf50aae9.tar.xz userdrake-9d28bdae4fd6ac0969b6daaddb47cecebf50aae9.zip |
- some features added:
Give the status of the account in main window
-rwxr-xr-x | userdrake | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -70,7 +70,7 @@ sub HelpSystem { system("drakhelp Drakxtools-Guide.html/userdrake.html &") }; $us->{wnd} = ugtk2->new(N("Mandrake Linux Users Management Tool") . " " . $us->{VERSION}, center => 1); gtkset_size_request($us->{wnd}{window}, 660, 460); $us->{wnd}{rwindow}->signal_connect(delete_event => \&QuitGlobal); -my $utree_model = Gtk2::ListStore->new(Gtk2::GType->STRING, Gtk2::GType->INT, Gtk2::GType->STRING, Gtk2::GType->STRING, Gtk2::GType->STRING, Gtk2::GType->STRING ); +my $utree_model = Gtk2::ListStore->new(Gtk2::GType->STRING, Gtk2::GType->INT, Gtk2::GType->STRING, Gtk2::GType->STRING, Gtk2::GType->STRING, Gtk2::GType->STRING, Gtk2::GType->STRING ); my $gtree_model = Gtk2::ListStore->new(Gtk2::GType->STRING, Gtk2::GType->INT, Gtk2::GType->STRING ); my ($usertree, $grouptree); $usertree = CreateTree($utree_model); $grouptree = CreateTree($gtree_model); @@ -122,12 +122,12 @@ gtkadd($us->{wnd}{window}, 0, $toolb, 0, $searchBox, 1, $nb )); -my @ucolsize = (80, 50, 50, 120, 80, 80, -1); my @gcolsize =(100, 80, 160, -1) ; +my @ucolsize = (60, 45, 40, 120, 80, 120, 50, -1); my @gcolsize =(100, 80, 160, -1) ; each_index { my $col = Gtk2::TreeViewColumn->new_with_attributes($_, Gtk2::CellRendererText->new, 'text' => $::i); $col->set_min_width($ucolsize[$::i]); $usertree->append_column($col); -} (N("User Name"), N("User ID"), N("Primary Group"), N("Full Name"), N("Login Shell"), N("Home Directory")); +} (N("User Name"), N("User ID"), N("Primary Group"), N("Full Name"), N("Login Shell"), N("Home Directory"), N("Status")); each_index { my $col = Gtk2::TreeViewColumn->new_with_attributes($_, Gtk2::CellRendererText->new, 'text' => $::i); @@ -168,15 +168,15 @@ sub NotebookSwitch { } sub RefreshUsersFull { my ($filterusers, $strfilt) = @_; - my ($users, $gid, $group, $groupnm); + my ($users, $gid, $group, $groupnm, $expr); defined $ctx and $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) { - $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) ]); + $a = $l->Gid($GetValue); $group = $ctx->LookupGroupById($a); $groupnm = ''; $expr = $l->ShadowExpire($GetValue); + $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), 6 => $ctx->IsLocked($l)?N("Locked"):($expr != -1 ?N("Expired"):'')]); } } sub RefreshGroupsFull { @@ -527,8 +527,8 @@ sub Edit { 0, $us->{o}->{acheckexpire} = Gtk2::CheckButton->new(N("Enable account expiration")), 0, gtkpack__(my $h = Gtk2::HBox->new(0, 10), 0, Gtk2::Label->new(N("Account expires MM/DD/YYYY :")), - 0, map { my $s = $_->[0]; my $t = $_->[1]; my $s = $_->[2]; - $us->{o}->{$s} = GtkEntrySized($t, $s), + 0, map { my $s = $_->[0]; my $t = $_->[1]; my $spc = $_->[2]; + $us->{o}->{$s} = GtkEntrySized($t, $spc), } (['expm', 2, 25], ['expd', 2, 25], ['expy', 4, 40]), ), 0, Gtk2::HSeparator->new, @@ -673,8 +673,8 @@ sub Edit { $ugid = $ent->Gid($GetValue); $userEnt->Gid($ugid); if ($us->{o}->{acheckexpire}->get_active()) { - print "test"; - my $yr = $us->{o}->{expy}->get_text(); my $mo = $us->{o}->{expm}->get_text(); + my $yr = $us->{o}->{expy}->get_text(); + my $mo = $us->{o}->{expm}->get_text(); my $dy = $us->{o}->{expd}->get_text(); $yr && $dy && $mo or RaiseError(N("Please specify Year, Month and Day \n for Account Expiration ")); $Exp = ConvTime($dy, $mo, $yr); |