From: Arthur Schiwon Date: Mon, 3 Jun 2013 21:07:32 +0000 (+0200) Subject: LDAP: append port when URL is passed in LDAP Host configuration, fixes #2600 X-Git-Tag: v6.0.0alpha2~681 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4976f2e0d363e980a90745bb2e2cb93d5dd2f5cb;p=nextcloud-server.git LDAP: append port when URL is passed in LDAP Host configuration, fixes #2600 --- diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php index 409f3758792..31150a5bec5 100644 --- a/apps/user_ldap/lib/connection.php +++ b/apps/user_ldap/lib/connection.php @@ -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)) {