summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmenus_launcher.pl12
1 files changed, 5 insertions, 7 deletions
diff --git a/menus_launcher.pl b/menus_launcher.pl
index cc50e1f3..17dfcb11 100755
--- a/menus_launcher.pl
+++ b/menus_launcher.pl
@@ -37,14 +37,12 @@ $table->attach(Gtk2::Label->new(N("System menu")), 0, 1, 0, 1, 'fill', 'fill', 0
my $b1 = gtksignal_connect(Gtk2::Button->new(N("Configure...")), clicked => sub { system("$bindir/menudrake --systemmenu &") });
$table->attach($b1, 1, 2, 0, 1, 'fill', 'fill', 0, 0);
$table->attach(Gtk2::Label->new(N("User menu")), 0, 1, 1, 2, 'fill', 'fill', 0, 0);
-my (@user_info, @usernames);
-setpwent();
-do { @user_info = getpwent();
- my ($uname, $uid) = @user_info[0, 2];
- push(@usernames, $uname) if $uid > 500 && $uname eq $ENV{INITIAL_USER};
- } while @user_info;
+
my $combo = Gtk2::Combo->new;
-$combo->set_popdown_strings(@usernames, "root");
+$combo->set_popdown_strings(map {
+ my ($username, undef, $uid) = @$_;
+ if_($uid == 0 || 500 < $uid && $username ne "nobody", $username);
+} &list_passwd());
$table->attach($combo, 2, 3, 1, 2, 'fill', 'fill', 0, 0);
my $b2 = gtksignal_connect(Gtk2::Button->new(N("Configure...")),
clicked => sub { my $a = $combo->entry->get_text(); system($a eq "root" ? "$bindir/menudrake --usermenu &" : " su $a -c \"$bindir/menudrake &\"") });