summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authoreseyman%linagora.com <>2008-06-27 23:45:59 +0200
committereseyman%linagora.com <>2008-06-27 23:45:59 +0200
commit56ccd58774980ac41436242ac1a5ed223f8868aa (patch)
tree09ac35f4a7d7118d985702091bf0b222d67b93c8 /contrib
parent05f7de70195edff91548dfc0c166b396e2fe7dd2 (diff)
downloadbugzilla-56ccd58774980ac41436242ac1a5ed223f8868aa.tar.gz
bugzilla-56ccd58774980ac41436242ac1a5ed223f8868aa.tar.xz
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')
-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;