summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorjocuri%softhome.net <>2006-03-04 21:08:31 +0100
committerjocuri%softhome.net <>2006-03-04 21:08:31 +0100
commit92d1e8e22643ff141b4c530d0100ad3a11676a86 (patch)
treeda46e3b66eb34058c659696187ebe3721bdfd5d0 /Bugzilla
parent6c3686bbc8a7abe68b7137d52784e47e0269ddf3 (diff)
downloadbugzilla-92d1e8e22643ff141b4c530d0100ad3a11676a86.tar.gz
bugzilla-92d1e8e22643ff141b4c530d0100ad3a11676a86.tar.xz
Patch for bug 216902: support LDAPS connections; patch by Christian Krause <chkr@plauener.de>, r=vladd, a=justdave.
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Auth/Verify/LDAP.pm25
1 files changed, 22 insertions, 3 deletions
diff --git a/Bugzilla/Auth/Verify/LDAP.pm b/Bugzilla/Auth/Verify/LDAP.pm
index e8e744971..376fac71d 100644
--- a/Bugzilla/Auth/Verify/LDAP.pm
+++ b/Bugzilla/Auth/Verify/LDAP.pm
@@ -73,10 +73,29 @@ sub authenticate {
}
my $LDAPport = "389"; # default LDAP port
- if($LDAPserver =~ /:/) {
- ($LDAPserver, $LDAPport) = split(":",$LDAPserver);
+ my $LDAPprotocol = "ldap";
+
+ if ($LDAPserver =~ /(ldap|ldaps):\/\/(.*)/) {
+ # ldap(s)://server(:port)
+ $LDAPprotocol = $1;
+ my $serverpart = $2;
+ if ($serverpart =~ /:/) {
+ # ldap(s)://server:port
+ ($LDAPserver, $LDAPport) = split(":", $serverpart);
+ } else {
+ # ldap(s)://server
+ $LDAPserver = $serverpart;
+ if ($LDAPprotocol eq "ldaps") {
+ $LDAPport = "636";
+ }
+ }
+ } elsif ($LDAPserver =~ /:/) {
+ # server:port
+ ($LDAPserver, $LDAPport) = split(":", $LDAPserver);
}
- my $LDAPconn = Net::LDAP->new($LDAPserver, port => $LDAPport, version => 3);
+
+
+ my $LDAPconn = Net::LDAP->new("$LDAPprotocol://$LDAPserver:$LDAPport", version => 3);
if(!$LDAPconn) {
return (AUTH_ERROR, undef, "connect_failed");
}