diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-01-11 20:18:32 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-01-11 20:18:32 +0000 |
commit | b0b847d35c8e3d765b47d4022cd5890d947b84fb (patch) | |
tree | 2d72f94fe7286eed3bb75a2e2850c3a8757c2d98 /perl-install/any.pm | |
parent | 1c5d508bf3f0b6099facdc3413c2f1955e34c8aa (diff) | |
download | drakx-backup-do-not-use-b0b847d35c8e3d765b47d4022cd5890d947b84fb.tar drakx-backup-do-not-use-b0b847d35c8e3d765b47d4022cd5890d947b84fb.tar.gz drakx-backup-do-not-use-b0b847d35c8e3d765b47d4022cd5890d947b84fb.tar.bz2 drakx-backup-do-not-use-b0b847d35c8e3d765b47d4022cd5890d947b84fb.tar.xz drakx-backup-do-not-use-b0b847d35c8e3d765b47d4022cd5890d947b84fb.zip |
*** empty log message ***
Diffstat (limited to 'perl-install/any.pm')
-rw-r--r-- | perl-install/any.pm | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm index 157f697f2..a74476345 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -253,7 +253,14 @@ sub pack_passwd { join(':', @$l{@etc_pass_fields}) . "\n"; } -sub setAutologin { +sub get_autologin { + my ($prefix, $o) = @_; + my %l = getVarsFromSh("$prefix/etc/sysconfig/autologin"); + $o->{autologin} ||= $l{USER}; + $o->{desktop} ||= map { chomp; $_ } cat_("$prefix/etc/sysconfig/desktop"); +} + +sub set_autologin { my ($prefix, $user, $desktop) = @_; output "$prefix/etc/sysconfig/desktop", uc($desktop), "\n" if $user; @@ -658,25 +665,21 @@ sub ask_users { } } -#sub autologin { -# my ($prefix, $o, $in, $install) = @_; -# -# my $cmd = $prefix ? "chroot $prefix" : ""; -# my @wm = (split (' ', `$cmd /usr/sbin/chksession -l`)); -# -# if (@wm && @users && !$o->{authentication}{NIS} && $ENV{SECURE_LEVEL} <= 3) { -# my %l = getVarsFromSh("$prefix/etc/sysconfig/autologin"); -# $o->{autologin} ||= $l{USER}; -# $in->ask_from_entries_refH(_("Autologin"), -# _("I can set up your computer to automatically log on one user. -#If you don't want to use this feature, click on the cancel button."), -# [ { label => _("Choose the default user:"), val => \$o->{autologin}, list => [ '', @users ] }, -# { label => _("Choose the window manager to run:"), val => \$o->{desktop}, list => \@wm }, ]) or delete $o->{autologin}; -# } -# -# $o->{autologin} and $install->("autologin"); -# setAutologin($prefix, $o->{autologin}, $o->{desktop}); -#} +sub autologin { + my ($prefix, $o, $in, $install) = @_; + + my $cmd = $prefix ? "chroot $prefix" : ""; + my @wm = (split (' ', `$cmd /usr/sbin/chksession -l`)); + my @users; + + if (@wm && @users && !$o->{authentication}{NIS} && $ENV{SECURE_LEVEL} <= 3) { + $in->ask_from_entries_refH(_("Autologin"), + _("I can set up your computer to automatically log on one user. +If you don't want to use this feature, click on the cancel button."), + [ { label => _("Choose the default user:"), val => \$o->{autologin}, list => [ '', @users ] }, + { label => _("Choose the window manager to run:"), val => \$o->{desktop}, list => \@wm }, ]) or delete $o->{autologin}; + } +} sub write_passwd_user { my ($prefix, $u, $isMD5) = @_; |