From f093421759947c0e1020139c8b0bdb057105c074 Mon Sep 17 00:00:00 2001 From: damien Date: Fri, 4 Aug 2000 15:23:47 +0000 Subject: updated autologin. --- perl-install/ChangeLog | 5 +++++ perl-install/Xconfigurator.pm | 44 +++++++++---------------------------------- perl-install/any.pm | 8 ++++++++ 3 files changed, 22 insertions(+), 35 deletions(-) diff --git a/perl-install/ChangeLog b/perl-install/ChangeLog index 64b05d633..342646318 100644 --- a/perl-install/ChangeLog +++ b/perl-install/ChangeLog @@ -1,3 +1,8 @@ +2000-08-04 Pixel + + * any.pm (setAutoLogin): added this method to write xdm-config + * Xconfigurator.pm: clenead autologin code and use of above method + 2000-08-04 Pixel * pkgs.pm (setSelectedFromCompssList): save $nb to able to restore diff --git a/perl-install/Xconfigurator.pm b/perl-install/Xconfigurator.pm index 08eabf1d4..f0f51c162 100644 --- a/perl-install/Xconfigurator.pm +++ b/perl-install/Xconfigurator.pm @@ -1094,41 +1094,15 @@ Would you like X to start when you reboot?"), 1); my %l; @l{@etc_pass_fields} = split ':'; $l{uid} > 500, $l{name}; } cat_("$o->{prefix}/etc/passwd"); - if (!(exists $o->{miscellaneous}{autologuser} || $::auto || !@users || exists $o->{authentication}{NIS} )) - { - if($in->ask_from_entries_refH(_("Autologin"), - _("I can set up your computer to automatically log on one user. + + !(exists $o->{miscellaneous}{autologuser} || $::auto || !@users || exists $o->{authentication}{NIS} ) && + $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."), -[ _("Choose the default user :") => {val => \$o->{miscellaneous}{autologuser}, list => \@users, not_edit => 1} ], )) { - my (@lines, $autoString, $autoUser); - open (F, "$prefix/etc/X11/xdm/xdm_config"); - foreach () { - /DisplayManager._0.autoUser/ and $autoUser=1; - /DisplayManager._0.autoString/ and $autoString=1; - } - close F; - if ( $autoUser) { - substInFile { - s/^(DisplayManager._0.autoUser):.*/$1:\t$o->{miscellaneous}{autologuser}/; - } "$prefix/etc/X11/xdm/xdm_config" - } else { - open F, ">>$prefix/etc/X11/xdm/xdm_config" or die "Can't append $prefix/etc/X11/xdm/xdm_config !"; - print F "\nDisplayManager._0.autoUser:\t$o->{miscellaneous}{autologuser}"; - close F; - } - if ( $autoString) { - substInFile { - s/^(DisplayManager._0.autoString):.*/$1:\tkde\n/; # Change it when /etc/wmsession.d is complete. - } "$prefix/etc/X11/xdm/xdm_config" - } else { - open F, ">>$prefix/etc/X11/xdm/xdm_config" or die "Can't append $prefix/etc/X11/xdm/xdm_config !"; - print F "\nDisplayManager._0.autoString:\tkde\n"; - close F; - } - # (dam's) : a patch for gdm is being done. - } - } - } - run_program::rooted($prefix, "chkconfig", "--del", "gpm") if $o->{mouse}{device} =~ /ttyS/ && !$::isStandalone; +[ _("Choose the default user :") => {val => \$o->{miscellaneous}{autologuser}, list => \@users, not_edit => 1} ], ) + or delete $o->{miscellaneaous}{autologuser}; + set_autologin($prefix, $o->{miscellaneous}{autologuser}, "kde" ) if (@users && !exists $o->{authentication}{NIS} && exists $o->{miscellaneous}{autologuser}); + } + run_program::rooted($prefix, "chkconfig", "--del", "gpm") if $o->{mouse}{device} =~ /ttyS/ && !$::isStandalone; } } diff --git a/perl-install/any.pm b/perl-install/any.pm index 52b33a9ad..ec38ba7b1 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -199,4 +199,12 @@ _("Default") => { val => \$default, type => 'bool' }, 1; } +sub setAutologin { + my ($prefix, $user, $wm) = @_; + my $f="$prefix/etc/X11/xdm/xdm_config"; + substInFile { s/^(DisplayManager._0.autoUser).*\n//; $_ .= "DisplayManager._0.autoUser:\t$user\n" if eof } $f; + substInFile { s/^(DisplayManager._0.autoString).*\n//; $_ .= "DisplayManager._0.autoString:\t$wm\n" if eof } $f; + # (dam's) : a patch for gdm is being done. +} + 1; -- cgit v1.2.1