From bcf7157e9f5fa5eb3ea2a4925d97ef5d26c9347d Mon Sep 17 00:00:00 2001 From: damien Date: Thu, 21 Dec 2000 12:34:48 +0000 Subject: if firewall, admin password obliged --- perl-install/install_steps_interactive.pm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index d7a5fb728..f0daf96fa 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -794,6 +794,7 @@ _("Use NIS") => { val => \$nis, type => 'bool', text => _("yellow pages") }, sub addUser { my ($o, $clicked) = @_; my $u = $o->{user} ||= {}; + my $admin = $o->{adminuser} ||= {}; if ($o->{security} < 1) { add2hash_($u, { name => "mandrake", password => "mandrake", realname => "default", icon => 'automagic' }); $o->{users} ||= [ $u ]; @@ -803,6 +804,20 @@ sub addUser { my @fields = qw(realname name password password2); my @shells = map { chomp; $_ } cat_("$o->{prefix}/etc/shells"); + $o->{meta_class} eq 'firewall' and !$admin->{set} and + $o->ask_from_entries_refH([_("Set admin password"), _("Ok"), $o->{security} > 2 || $::corporate ? () : _("No password")], + [ _("Set admin password"), "\n" ], [ +_("Password") => { val => \$admin->{password}, hidden => 1 }, +_("Password (again)") => { val => \$admin->{password2}, hidden => 1 } + ], + complete => sub { + $admin->{password} eq $admin->{password2} or $o->ask_warn('', [ _("The passwords do not match"), _("Please try again") ]), return (1,1); + length $admin->{password} < 2 * $o->{security} + and $o->ask_warn('', _("This password is too simple (must be at least %d characters long)", 2 * $o->{security})), return (1,0); + return 0 + } + ) and $admin->{set}=1 or return; + install_steps::setAdminPassword($o); if (($o->{security} >= 1 || $clicked)) { $u->{icon} = translate($u->{icon}); if ($o->ask_from_entries_refH( @@ -1109,7 +1124,7 @@ Do you really want to quit now?"), 0); $o->exit unless $alldone; - if ($::firewall) { + if ($o->{meta_class} eq 'firewall') { $o->ask_warn('', _("Congratulations, installation is complete. Remove the boot media and press return to reboot. -- cgit v1.2.1