forked from extern/egroupware
small docu about creating ssl (ldaps) or tls connections
This commit is contained in:
parent
ff867f4daf
commit
2cc8585ecb
@ -14,6 +14,11 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* LDAP connection handling
|
* 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
|
class ldap
|
||||||
{
|
{
|
||||||
@ -105,10 +110,10 @@ class ldap
|
|||||||
$passwd = $GLOBALS['egw_info']['server']['ldap_root_pw'];
|
$passwd = $GLOBALS['egw_info']['server']['ldap_root_pw'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($use_tls = substr($host,0,6) == 'tls://'))
|
if (($use_tls = substr($host,0,6) == 'tls://'))
|
||||||
{
|
{
|
||||||
$host = parse_url($host,PHP_URL_HOST);
|
$host = parse_url($host,PHP_URL_HOST);
|
||||||
}
|
}
|
||||||
// connects to ldap server
|
// connects to ldap server
|
||||||
if(!$this->ds = ldap_connect($host))
|
if(!$this->ds = ldap_connect($host))
|
||||||
{
|
{
|
||||||
@ -132,7 +137,7 @@ class ldap
|
|||||||
{
|
{
|
||||||
$supportedLDAPVersion = 2;
|
$supportedLDAPVersion = 2;
|
||||||
}
|
}
|
||||||
if ($use_tls) ldap_start_tls($this->ds);
|
if ($use_tls) ldap_start_tls($this->ds);
|
||||||
|
|
||||||
if(!isset($this->ldapServerInfo[$host]))
|
if(!isset($this->ldapServerInfo[$host]))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user