Add Active Directory support (closes 1876288).

This is slightly modified from Aiko's patch to apply cleanly and add
a few more comments to the example config.
This commit is contained in:
Aiko Barz authored and Andrew Ruthven committed 2008-02-15 13:57:04 +13:00
1 parent 4ce605f13a
commit a4df7abe9f
2 files changed
+36 -5

No files matched your search

+9 -5
View File
@@ -50,6 +50,13 @@ class ldapDrivers
$this->valid=false;
return ;
}
//Set LDAP protocol version
if (isset($config['protocolVersion']))
ldap_set_option($this->connect, LDAP_OPT_PROTOCOL_VERSION, $config['protocolVersion']);
if (isset($config['optReferrals']))
ldap_set_option($this->connect, LDAP_OPT_REFERRALS, $config['optReferrals']);
if ($port)
$this->connect=ldap_connect($host, $port);
else
@@ -63,9 +70,6 @@ class ldapDrivers
dbg_error_log( "LDAP", "drivers_ldap : Connected to LDAP server %s",$host );
//Set LDAP protocol version
if (isset($config['protocolVersion'])) ldap_set_option($this->connect,LDAP_OPT_PROTOCOL_VERSION, $config['protocolVersion']);
// Start TLS if desired (requires protocol version 3)
if (isset($config['startTLS'])) {
if (!ldap_set_option($this->connect, LDAP_OPT_PROTOCOL_VERSION, 3)) {
@@ -89,11 +93,11 @@ class ldapDrivers
break;
case "onelevel":
$this->ldap_query_one = ldap_list;
$this->ldap_query_all = ldap_list;
$this->ldap_query_all = ldap_search;
break;
default:
$this->ldap_query_one = ldap_search;
$this->ldap_query_all = ldap_list;
$this->ldap_query_all = ldap_search;
break;
}