LDAP: append port when URL is passed in LDAP Host configuration, fixes #2600

This commit is contained in:
Arthur Schiwon 2013-06-03 23:07:32 +02:00
parent bc50d92841
commit 4976f2e0d3
1 changed files with 4 additions and 0 deletions

View File

@ -621,6 +621,10 @@ class Connection {
if(empty($host)) {
return false;
}
if(strpos($host, '://') !== false) {
//ldap_connect ignores port paramater when URLs are passed
$host .= ':' . $port;
}
$this->ldapConnectionRes = ldap_connect($host, $port);
if(ldap_set_option($this->ldapConnectionRes, LDAP_OPT_PROTOCOL_VERSION, 3)) {
if(ldap_set_option($this->ldapConnectionRes, LDAP_OPT_REFERRALS, 0)) {