diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2015-10-29 16:21:02 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2015-11-04 15:49:55 +0100 |
commit | fe21a8dddb3c23c7db12d060d5db2f84dcbd90f6 (patch) | |
tree | b1e9bdb1c5201d3845aceeb79ec7331811fe4d03 /apps | |
parent | 258496c951d5a25662eae780f360c9a1e2171b44 (diff) | |
download | nextcloud-server-fe21a8dddb3c23c7db12d060d5db2f84dcbd90f6.tar.gz nextcloud-server-fe21a8dddb3c23c7db12d060d5db2f84dcbd90f6.zip |
add port to host only, if an URL is used instead of a plain hostname
Diffstat (limited to 'apps')
-rw-r--r-- | apps/user_ldap/lib/wizard.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/user_ldap/lib/wizard.php b/apps/user_ldap/lib/wizard.php index 5a504cc1772..71d0071fc95 100644 --- a/apps/user_ldap/lib/wizard.php +++ b/apps/user_ldap/lib/wizard.php @@ -1249,9 +1249,13 @@ class Wizard extends LDAPUtility { if(!is_null($this->cr)) { return $this->cr; } - $cr = $this->ldap->connect( - $this->configuration->ldapHost.':'.$this->configuration->ldapPort, - $this->configuration->ldapPort); + + $host = $this->configuration->ldapHost; + if(strpos($host, '://') !== false) { + //ldap_connect ignores port parameter when URLs are passed + $host .= ':' . $this->configuration->ldapPort; + } + $cr = $this->ldap->connect($host, $this->configuration->ldapPort); $this->ldap->setOption($cr, LDAP_OPT_PROTOCOL_VERSION, 3); $this->ldap->setOption($cr, LDAP_OPT_REFERRALS, 0); |