From 3891b63a1eb52076337885487f251a10580a4a85 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Wed, 27 Apr 2016 18:50:13 +0200 Subject: Bug 218917 - Allow the login name to be different from the email address Original patch by Gervase Markham r=gerv a=dkl --- Bugzilla/Auth/Verify/LDAP.pm | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'Bugzilla/Auth/Verify/LDAP.pm') diff --git a/Bugzilla/Auth/Verify/LDAP.pm b/Bugzilla/Auth/Verify/LDAP.pm index cd2e64370..2ff38a217 100644 --- a/Bugzilla/Auth/Verify/LDAP.pm +++ b/Bugzilla/Auth/Verify/LDAP.pm @@ -99,23 +99,21 @@ sub check_credentials { my @emails = $user_entry->get_value($mail_attr); # Default to the first email address returned. - $params->{bz_username} = $emails[0]; + $params->{email} = $emails[0]; if (@emails > 1) { # Cycle through the adresses and check if they're Bugzilla logins. # Use the first one that returns a valid id. foreach my $email (@emails) { - if ( login_to_id($email) ) { - $params->{bz_username} = $email; + if ( email_to_id($email) ) { + $params->{email} = $email; last; } } } - - } else { - $params->{bz_username} = $username; } + $params->{bz_username} = $username; $params->{realname} ||= $user_entry->get_value("displayName"); $params->{realname} ||= $user_entry->get_value("cn"); -- cgit v1.2.3-24-g4f1b