From 21f753634113afa55eda54a495017c5eef8fc462 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 20 Jul 2000 00:28:02 +0000 Subject: no_comment --- perl-install/Xconfigurator.pm | 49 ++++++++++++++++--------------------------- 1 file changed, 18 insertions(+), 31 deletions(-) (limited to 'perl-install/Xconfigurator.pm') diff --git a/perl-install/Xconfigurator.pm b/perl-install/Xconfigurator.pm index da65dda90..f2cb51bcf 100644 --- a/perl-install/Xconfigurator.pm +++ b/perl-install/Xconfigurator.pm @@ -1020,35 +1020,22 @@ _("I can set up your computer to automatically start X upon booting. Would you like X to start when you reboot?"), 1); rewriteInittab($run ? 5 : 3) unless $::testing; - if ($o->{miscellaneous}{autologin} || $::auto || $in->ask_yesorno(_("Autologin at startup"), - _("I can set up your computer to automatically log on one user. -Would you like to use this feature?"), 1)) - { - $o->{miscellaneous}{autologin}=1; - my @users; - my @etc_pass_fields = qw(name pw uid gid realname home shell); - my @lines = cat_(my $f = "$o->{prefix}/etc/passwd") or log::l("missing passwd file"), return; - foreach (@lines) { - my %l; @l{@etc_pass_fields} = split ':'; - if ($l{"uid"} > 500) { - push @users, $l{"name"}; - } - } - if ( $in->ask_from_entries_refH( - [ _("Autologin"), _("Ok"), _("Cancel") ], - _("Autologin - Choose default user\n"), - [ _("Choose the default user :") => {val => \$o->{miscellaneous}{autologuser}, list => \@users, not_edit => 1} ], - complete => sub { - $o->{miscellaneous}{autologuser} or $in->ask_warn('', _("Please choose a user in the list")), return (1,0); - return 0; - } - )) - { - $o->{miscellaneous}{autologin}=1; - } - else { $o->{miscellaneous}{autologin}=0; } - } - } + my @etc_pass_fields = qw(name pw uid gid realname home shell); + my @users = mapgrep { + my %l; @l{@etc_pass_fields} = split ':'; + $l{uid} > 500, $l{name}; + } cat_("$o->{prefix}/etc/passwd"); + + if (exists $o->{miscellaneous}{autologin} || $::auto || @users + || $in->ask_yesorno(_("Autologin at startup"), +_("I can set up your computer to automatically log on one user. +Would you like to use this feature?"), 1)) { + $o->{miscellaneous}{autologin} = $in->ask_from_entries_refH(_("Autologin"), + _("Autologin - Choose default user\n"), + [ _("Choose the default user :") => {val => \$o->{miscellaneous}{autologuser}, list => \@users, not_edit => 1} ], + ); + } + } run_program::rooted($prefix, "chkconfig", "--del", "gpm") if $o->{mouse}{device} =~ /ttyS/ && !$::isStandalone; - } - } + } +} -- cgit v1.2.1