aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreseyman%linagora.com <>2008-06-27 21:45:59 +0000
committereseyman%linagora.com <>2008-06-27 21:45:59 +0000
commit56ccd58774980ac41436242ac1a5ed223f8868aa (patch)
tree09ac35f4a7d7118d985702091bf0b222d67b93c8 /contrib/syncLDAP.pl
parentBug 394574: bzdbcopy should avoid reading entire tables into memory (diff)
downloadbugzilla-56ccd58774980ac41436242ac1a5ed223f8868aa.tar.gz
bugzilla-56ccd58774980ac41436242ac1a5ed223f8868aa.tar.bz2
bugzilla-56ccd58774980ac41436242ac1a5ed223f8868aa.zip
Bug 441503: Need update on contrib/syncLDAP.pl
Patch by A.A. Shimono <shimono@mozilla.gr.jp> r=manu a=LpSolit
Diffstat (limited to 'contrib/syncLDAP.pl')
-rwxr-xr-xcontrib/syncLDAP.pl15
1 files changed, 11 insertions, 4 deletions
diff --git a/contrib/syncLDAP.pl b/contrib/syncLDAP.pl
index dc0708f60..51ee5c1fa 100755
--- a/contrib/syncLDAP.pl
+++ b/contrib/syncLDAP.pl
@@ -96,12 +96,19 @@ if ($LDAPserver eq "") {
print "No LDAP server defined in bugzilla preferences.\n";
exit;
}
-my $LDAPport = "389"; # default LDAP port
-if($LDAPserver =~ /:/) {
- ($LDAPserver, $LDAPport) = split(":",$LDAPserver);
+
+my $LDAPconn;
+if($LDAPserver =~ /\:\/\//) {
+ # if the "LDAPserver" parameter is in uri scheme
+ $LDAPconn = Net::LDAP->new($LDAPserver, version => 3);
+} else {
+ my $LDAPport = "389"; # default LDAP port
+ if($LDAPserver =~ /:/) {
+ ($LDAPserver, $LDAPport) = split(":",$LDAPserver);
+ }
+ $LDAPconn = Net::LDAP->new($LDAPserver, port => $LDAPport, version => 3);
}
-my $LDAPconn = Net::LDAP->new($LDAPserver, port => $LDAPport, version => 3);
if(!$LDAPconn) {
print "Connecting to LDAP server failed. Check LDAPserver setting.\n";
exit;