aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/ldap.php
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2015-07-28 12:14:05 +0200
committerArthur Schiwon <blizzz@owncloud.com>2015-12-05 00:09:15 +0100
commita32b002cff4ace48a06fe7f45be85cb64862fbbe (patch)
tree6052d6f075fac8a2cb56c77c810164bd9b218b7b /apps/user_ldap/lib/ldap.php
parente91eba4b5bd856cb1ef81996ace6d16c09f1bb01 (diff)
downloadnextcloud-server-a32b002cff4ace48a06fe7f45be85cb64862fbbe.tar.gz
nextcloud-server-a32b002cff4ace48a06fe7f45be85cb64862fbbe.zip
always use an LDAP URL when connecting to LDAP
Diffstat (limited to 'apps/user_ldap/lib/ldap.php')
-rw-r--r--apps/user_ldap/lib/ldap.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/user_ldap/lib/ldap.php b/apps/user_ldap/lib/ldap.php
index 4d45db2e155..e730bff82c3 100644
--- a/apps/user_ldap/lib/ldap.php
+++ b/apps/user_ldap/lib/ldap.php
@@ -48,7 +48,14 @@ class LDAP implements ILDAPWrapper {
* @return mixed
*/
public function connect($host, $port) {
- return $this->invokeLDAPMethod('connect', $host, $port);
+ if(strpos($host, '://') === false) {
+ $host = 'ldap://' . $host;
+ }
+ if(strpos($host, ':', strpos($host, '://') + 1) === false) {
+ //ldap_connect ignores port parameter when URLs are passed
+ $host .= ':' . $port;
+ }
+ return $this->invokeLDAPMethod('connect', $host);
}
/**