summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-07-11 09:42:57 +0200
committerlpsolit%gmail.com <>2006-07-11 09:42:57 +0200
commitdbb4dc8e4e689253f0e9c5d162f342e8e652c456 (patch)
tree8fab15635de6a6b6d6c64c8a739bb2d635000cac /Bugzilla
parentc47738d0f23009636eae897da087105044ee23b5 (diff)
downloadbugzilla-dbb4dc8e4e689253f0e9c5d162f342e8e652c456.tar.gz
bugzilla-dbb4dc8e4e689253f0e9c5d162f342e8e652c456.tar.xz
Bug 339731: [LDAP] URI-parsing code duplicated with Net::LDAP - Patch by guillomovitch@zarb.org r=mkanat a=justdave
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Auth/Verify/LDAP.pm30
1 files changed, 2 insertions, 28 deletions
diff --git a/Bugzilla/Auth/Verify/LDAP.pm b/Bugzilla/Auth/Verify/LDAP.pm
index 9f050d854..343f7952c 100644
--- a/Bugzilla/Auth/Verify/LDAP.pm
+++ b/Bugzilla/Auth/Verify/LDAP.pm
@@ -40,9 +40,6 @@ use Bugzilla::Error;
use Net::LDAP;
-use constant DEFAULT_PORT => 389;
-use constant DEFAULT_SSL_PORT => 636;
-
use constant admin_can_create_account => 0;
use constant user_can_create_account => 0;
@@ -140,31 +137,8 @@ sub ldap {
my $server = Bugzilla->params->{"LDAPserver"};
ThrowCodeError("ldap_server_not_defined") unless $server;
- my $port = DEFAULT_PORT;
- my $protocol = "ldap";
-
- if ($server =~ /(ldap|ldaps):\/\/(.*)/) {
- # ldap(s)://server(:port)
- $protocol = $1;
- my $server_part = $2;
- if ($server_part =~ /:/) {
- # ldap(s)://server:port
- ($server, $port) = split(":", $server_part);
- } else {
- # ldap(s)://server
- $server = $server_part;
- if ($protocol eq "ldaps") {
- $port = DEFAULT_SSL_PORT;
- }
- }
- } elsif ($server =~ /:/) {
- # server:port
- ($server, $port) = split(":", $server);
- }
-
- my $conn_string = "$protocol://$server:$port";
- $self->{ldap} = new Net::LDAP($conn_string)
- || ThrowCodeError("ldap_connect_failed", { server => $conn_string });
+ $self->{ldap} = new Net::LDAP($server)
+ || ThrowCodeError("ldap_connect_failed", { server => $server });
# try to start TLS if needed
if (Bugzilla->params->{"LDAPstarttls"}) {