Updated ldap_connect to use modern LDAP schema for better TLS support.

This commit is contained in:
Ben Tyger 2021-05-18 14:14:59 -04:00
parent 63e78d840d
commit 7e0e0db384

View file

@ -35,7 +35,10 @@ abstract class AuthController extends Controller
return false;
}
$server = ldap_connect($this->config['ldap']['host'], $this->config['ldap']['port']);
$ldapSchema=array_key_exists('schema', $this->config['ldap']) ?
strtolower($this->config['ldap']['schema']) : 'ldap';
$ldapURI="$ldapSchema://".$this->config['ldap']['host'].':'.$this->config['ldap']['port'];
$server = ldap_connect($ldapURI);
if ($server) {
ldap_set_option($server, LDAP_OPT_PROTOCOL_VERSION, 3);