mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-23 23:29:31 +01:00
allow to specify a port with tls too: "tls://host[:port]/" or "ldaps://host[:port]/" or "ldap://host[:port]/" or just "host"
This commit is contained in:
parent
ef21cdae30
commit
68b5c2d204
@ -14,10 +14,10 @@
|
||||
|
||||
/**
|
||||
* LDAP connection handling
|
||||
*
|
||||
*
|
||||
* Please note for SSL or TLS connections hostname has to be:
|
||||
* - SSL: "ldaps://host"
|
||||
* - TLS: "tls://host"
|
||||
* - SSL: "ldaps://host[:port]/"
|
||||
* - TLS: "tls://host[:port]/"
|
||||
* Both require certificats installed on the webserver, otherwise the connection will fail!
|
||||
*/
|
||||
class ldap
|
||||
@ -112,10 +112,11 @@ class ldap
|
||||
|
||||
if (($use_tls = substr($host,0,6) == 'tls://'))
|
||||
{
|
||||
$port = parse_url($host,PHP_URL_PORT);
|
||||
$host = parse_url($host,PHP_URL_HOST);
|
||||
}
|
||||
// connects to ldap server
|
||||
if(!$this->ds = ldap_connect($host))
|
||||
if(!$this->ds = ldap_connect($host, $port))
|
||||
{
|
||||
/* log does not exist in setup(, yet) */
|
||||
if(isset($GLOBALS['egw']->log))
|
||||
|
Loading…
Reference in New Issue
Block a user