diff options
-rw-r--r-- | perl-install/authentication.pm | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/perl-install/authentication.pm b/perl-install/authentication.pm index 762320c32..a76f6798d 100644 --- a/perl-install/authentication.pm +++ b/perl-install/authentication.pm @@ -45,12 +45,18 @@ sub ask_parameters { $authentication->{AD_users_db} ||= 'cn=users,' . domain_to_ldap_domain($val); my %sub_kinds = my @sub_kinds = ( - anonymous => N("anonymous"), simple => N("simple"), tls => N("TLS"), ssl => N("SSL"), kerberos => N("security layout (SASL/Kerberos)"), ); + + + + + + + my $AD_user = $authentication->{AD_user} =~ /(.*)\@\Q$val\E$/ ? $1 : $authentication->{AD_user}; $in->ask_from('', @@ -58,13 +64,15 @@ sub ask_parameters { [ { label => N("Domain"), val => \$val }, { label => N("Server"), val => \$authentication->{AD_server} }, { label => N("LDAP users database"), val => \$authentication->{AD_users_db} }, - { label => N("LDAP Authentication"), val => \$authentication->{sub_kind}, list => [ map { $_->[0] } group_by2(@sub_kinds) ], format => sub { $sub_kinds{$_[0]} } }, - { label => N("LDAP user allowed to browse the Active Directory"), val => \$AD_user, disabled => sub { $authentication->{sub_kind} eq 'anonymous' } }, + { label => N("LDAP user allowed to browse the Active Directory"), val => \$AD_user, }, { label => N("Password for user"), val => \$authentication->{AD_password}, disabled => sub { !$AD_user || $authentication->{sub_kind} eq 'anonymous' } }, + { label => N("LDAP Authentication"), val => \$authentication->{sub_kind}, list => [ map { $_->[0] } group_by2(@sub_kinds) ], format => sub { $sub_kinds{$_[0]} } }, ]) or return; $authentication->{AD_user} = !$AD_user || $authentication->{sub_kind} eq 'anonymous' ? '' : $AD_user =~ /@/ ? $AD_user : "$AD_user\@$val"; $authentication->{AD_password} = '' if !$authentication->{AD_user}; + + } elsif ($kind eq 'NIS') { $val ||= 'broadcast'; $in->ask_from('', |