From 937376d49922a492766b6d54f7a11246fce0c086 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 16 Feb 2004 17:07:26 +0000 Subject: keep current authentication kind, even if not completly accepted --- perl-install/authentication.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'perl-install/authentication.pm') diff --git a/perl-install/authentication.pm b/perl-install/authentication.pm index f69be8833..08bad2cc7 100644 --- a/perl-install/authentication.pm +++ b/perl-install/authentication.pm @@ -13,13 +13,18 @@ sub kind2description { } sub to_kind { my ($authentication) = @_; - (find { defined $authentication->{$_} } kinds()) || 'local'; + (find { exists $authentication->{$_} } kinds()) || 'local'; } sub ask_parameters { my ($in, $netc, $authentication, $kind) = @_; - my $val = $authentication->{$kind}; + #- keep only this authentication kind + foreach (kinds()) { + delete $authentication->{$_} if $_ ne $kind; + } + + my $val = $authentication->{$kind} ||= ''; if ($kind eq 'LDAP') { $val ||= 'ldap.' . $netc->{DOMAINNAME}; @@ -47,8 +52,6 @@ sub ask_parameters { { label => N("Domain Admin Password"), val => \$authentication->{winpass}, hidden => 1 }, ]) or return; } - #- keep only one authentication - delete $authentication->{$_} foreach kinds(); $authentication->{$kind} = $val; 1; } -- cgit v1.2.1