diff options
Diffstat (limited to 'perl-install/authentication.pm')
-rw-r--r-- | perl-install/authentication.pm | 11 |
1 files changed, 7 insertions, 4 deletions
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; } |