Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit f49aa90

Browse files
committed
Auth.ldap: add starttsl support. See #1248, should fix it.
1 parent 5ea81c5 commit f49aa90

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

core/src/plugins/auth.ldap/LdapAuthDriver.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,10 @@ public function startConnexion()
214214
if ($this->ldapconn == null) {
215215
$this->logError(__FUNCTION__, 'LDAP Server connexion could NOT be established');
216216
}
217+
if ($this->ldapconn !== null && isSet($this->options["LDAP_PROTOCOL"]) && $this->options["LDAP_PROTOCOL"] === 'starttls') {
218+
ldap_start_tls($this->ldapconn);
219+
}
217220
}
218-
//return $this->ldapconn;
219221
}
220222

221223
public function __deconstruct()

core/src/plugins/auth.ldap/manifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<!-- Server Connection -->
1313
<param name="LDAP_CONNECTION_LEGEND" group="CONF_MESSAGE[Server Connection]" type="legend" label="" description="CONF_MESSAGE[Set up main connection to server. Use the button to test that your parameters are correct.]"/>
1414
<param name="LDAP_URL" group="CONF_MESSAGE[Server Connection]" type="string" label="CONF_MESSAGE[LDAP URL]" description="CONF_MESSAGE[LDAP Server URL (IP or name)]" mandatory="true"/>
15-
<param name="LDAP_PROTOCOL" group="CONF_MESSAGE[Server Connection]" type="select" choices="ldap|Standard (ldap),ldaps|SSL (ldaps)" default="ldap" label="CONF_MESSAGE[Protocol]" description="CONF_MESSAGE[Connect through ldap or ldaps]" mandatory="true"/>
15+
<param name="LDAP_PROTOCOL" group="CONF_MESSAGE[Server Connection]" type="select" choices="ldap|Standard (ldap),ldaps|SSL (ldaps),starttls|StartTLS" default="ldap" label="CONF_MESSAGE[Protocol]" description="CONF_MESSAGE[Connect through ldap or ldaps]" mandatory="true"/>
1616
<param name="LDAP_PORT" group="CONF_MESSAGE[Server Connection]" type="string" label="CONF_MESSAGE[LDAP Port]" description="CONF_MESSAGE[LDAP Server Port (leave blank for default)]" mandatory="false" default="389"/>
1717
<param name="LDAP_USER" group="CONF_MESSAGE[Server Connection]" type="string" label="CONF_MESSAGE[LDAP bind username]" description="CONF_MESSAGE[Username (uid + dn) of LDAP bind user]" mandatory="false"/>
1818
<param name="LDAP_PASSWORD" group="CONF_MESSAGE[Server Connection]" type="string" label="CONF_MESSAGE[LDAP bind password]" description="CONF_MESSAGE[Password of LDAP bind user]" mandatory="false"/>

0 commit comments

Comments
 (0)