Skip to content
Snippets Groups Projects
Commit 7db6ac59 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

FIX Option start tls of ldap was not correctly supported.

parent ef336918
Branches
Tags
No related merge requests found
...@@ -149,7 +149,7 @@ class Ldap ...@@ -149,7 +149,7 @@ class Ldap
*/ */
function connect_bind() function connect_bind()
{ {
global $langs; global $langs, $conf;
$connected=0; $connected=0;
$this->bind=0; $this->bind=0;
...@@ -186,6 +186,17 @@ class Ldap ...@@ -186,6 +186,17 @@ class Ldap
if (is_resource($this->connection)) if (is_resource($this->connection))
{ {
// Begin TLS if requested by the configuration
if (! empty($conf->global->LDAP_SERVER_USE_TLS))
{
if (! ldap_start_tls($this->connection))
{
dol_syslog(get_class($this)."::connect_bind failed to start tls", LOG_WARNING);
$connected = 0;
$this->close();
}
}
// Execute the ldap_set_option here (after connect and before bind) // Execute the ldap_set_option here (after connect and before bind)
$this->setVersion(); $this->setVersion();
ldap_set_option($this->connection, LDAP_OPT_SIZELIMIT, 0); // no limit here. should return true. ldap_set_option($this->connection, LDAP_OPT_SIZELIMIT, 0); // no limit here. should return true.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment