diff options
Diffstat (limited to 'apps/user_ldap/lib/ldap.php')
-rw-r--r-- | apps/user_ldap/lib/ldap.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/user_ldap/lib/ldap.php b/apps/user_ldap/lib/ldap.php index 9d5cf4fee0a..63ec668dc03 100644 --- a/apps/user_ldap/lib/ldap.php +++ b/apps/user_ldap/lib/ldap.php @@ -45,7 +45,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); } /** |