small docu about creating ssl (ldaps) or tls connections

This commit is contained in:
Ralf Becker 2010-08-26 20:44:33 +00:00
parent ff867f4daf
commit 2cc8585ecb

View File

@ -14,6 +14,11 @@
/**
* LDAP connection handling
*
* Please note for SSL or TLS connections hostname has to be:
* - SSL: "ldaps://host"
* - TLS: "tls://host"
* Both require certificats installed on the webserver, otherwise the connection will fail!
*/
class ldap
{
@ -105,10 +110,10 @@ class ldap
$passwd = $GLOBALS['egw_info']['server']['ldap_root_pw'];
}
if (($use_tls = substr($host,0,6) == 'tls://'))
{
$host = parse_url($host,PHP_URL_HOST);
}
if (($use_tls = substr($host,0,6) == 'tls://'))
{
$host = parse_url($host,PHP_URL_HOST);
}
// connects to ldap server
if(!$this->ds = ldap_connect($host))
{
@ -132,7 +137,7 @@ class ldap
{
$supportedLDAPVersion = 2;
}
if ($use_tls) ldap_start_tls($this->ds);
if ($use_tls) ldap_start_tls($this->ds);
if(!isset($this->ldapServerInfo[$host]))
{