diff options
author | Daouda Lo <daouda@mandriva.com> | 2003-06-05 17:18:59 +0000 |
---|---|---|
committer | Daouda Lo <daouda@mandriva.com> | 2003-06-05 17:18:59 +0000 |
commit | 926ff99773475e273210195ca09897c2e0915362 (patch) | |
tree | 085d29f46e0df7ff55ed72154c514f251493702a /userdrake2 | |
parent | 33b633e9b1412e3d53ba2fb755fb3a68ee5b501c (diff) | |
download | userdrake-926ff99773475e273210195ca09897c2e0915362.tar userdrake-926ff99773475e273210195ca09897c2e0915362.tar.gz userdrake-926ff99773475e273210195ca09897c2e0915362.tar.bz2 userdrake-926ff99773475e273210195ca09897c2e0915362.tar.xz userdrake-926ff99773475e273210195ca09897c2e0915362.zip |
- delete group when deleting user
Diffstat (limited to 'userdrake2')
-rwxr-xr-x | userdrake2 | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -118,7 +118,6 @@ foreach (($tbedit, $tbdel, $checkedit, $checkdel)) { $_->set_sensitive(0) }; my $ctx = USER::ADMIN->new; Refresh($sysfilter); $nb->signal_connect('switch-page' => sub { NotebookSwitch() }); -#GetEvent($usertree); GetEvent($grouptree); $us->{wnd}{rwindow}->show_all; Gtk2->main; ugtk2->exit; @@ -344,21 +343,29 @@ sub AddGroup { $w->main; } - sub Delete { my $page = $nb->get_current_page(); if ($page == 0) { - print "page 0"; + my (undef, $iter) = $usertree->get_selection->get_selected; + my $username = $utree_model->get($iter,0); + $iter->free; + my $userEnt = $ctx->LookupUserByName($username); + $ctx->UserDel($userEnt); + my $groups = $ctx->GroupsEnumerateFull(); + Refresh($sysfilter) } elsif ($page == 1) { - print "page 1\n"; + my (undef, $iter) = $grouptree->get_selection->get_selected; + my $groupname = $gtree_model->get($iter,0); + my $groupEnt = $ctx->LookupGroupByName($groupname); + + $iter->free } - } # Gtk Facilities sub CreateTree { my ($tree_model) = @_; my $tree = Gtk2::TreeView->new_with_model($tree_model); - $tree->get_selection->set_mode('single'); + $tree->get_selection->set_mode('browse'); $tree->set_headers_visible(1); $tree->set_rules_hint(1); $tree->get_selection->signal_connect('changed' => sub { foreach (($tbedit, $tbdel, $checkedit, $checkdel)) { $_->set_sensitive(1);} }); |