diff options
author | mkanat%bugzilla.org <> | 2006-05-31 06:17:34 +0200 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2006-05-31 06:17:34 +0200 |
commit | ee385c93da32df2d6d956d537a4508f874679945 (patch) | |
tree | 217b357ae0c4419e8978ceaf9bd89d01f89b0ed5 /Bugzilla/Auth | |
parent | f3254c63caf96f5a1106272d8393a66f4a32fc42 (diff) | |
download | bugzilla-ee385c93da32df2d6d956d537a4508f874679945.tar.gz bugzilla-ee385c93da32df2d6d956d537a4508f874679945.tar.xz |
Bug 320751: LDAP: Ability to have Bugzilla use the LDAP username directly as the Bugzilla username
Patch By guillomovitch@zarb.org r=mkanat, a=myk
Diffstat (limited to 'Bugzilla/Auth')
-rw-r--r-- | Bugzilla/Auth/Verify/LDAP.pm | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Bugzilla/Auth/Verify/LDAP.pm b/Bugzilla/Auth/Verify/LDAP.pm index 848018549..dccfa0b7c 100644 --- a/Bugzilla/Auth/Verify/LDAP.pm +++ b/Bugzilla/Auth/Verify/LDAP.pm @@ -86,13 +86,18 @@ sub check_credentials { my $user_entry = $detail_result->shift_entry; my $mail_attr = Param("LDAPmailattribute"); - if (!$user_entry->exists($mail_attr)) { - return { failure => AUTH_ERROR, - error => "ldap_cannot_retreive_attr", - details => {attr => $mail_attr} }; + if ($mail_attr) { + if (!$user_entry->exists($mail_attr)) { + return { failure => AUTH_ERROR, + error => "ldap_cannot_retreive_attr", + details => {attr => $mail_attr} }; + } + + $params->{bz_username} = $user_entry->get_value($mail_attr); + } else { + $params->{bz_username} = $username; } - $params->{bz_username} = $user_entry->get_value($mail_attr); $params->{realname} ||= $user_entry->get_value("displayName"); $params->{realname} ||= $user_entry->get_value("cn"); |