Allow for the LDAP protocol version to be defined.

This commit is contained in:
Paul Willoughby 2007-08-15 07:51:59 +12:00 committed by Andrew McMillan
parent 703f09adfb
commit f9bf7ff170
2 changed files with 7 additions and 3 deletions

View File

@ -171,9 +171,9 @@ $c->admin_email ='calendar-admin@example.com';
// 'port' => '389', //port
// 'bindDN'=> 'cn=manager,cn=internal,dc=tennaxia,dc=net', //DN to bind to this server enabling to perform request
// 'passDN'=> 'xxxxxxxx', //Password of the previous bindDN to bind to this server enabling to perform request
// 'protocolVersion' => '3', //Version of LDAP protocol to use
// 'baseDNUsers'=> 'dc=tennaxia,dc=net', //where to look at valid user
// 'filterUsers' => 'objectClass=kolabInetOrgPerson', //filter that must validate an valid user syntax according :
//http://www.faqs.org/rfcs/rfc4515.html , that's mean surroundeed by ( and )
// 'filterUsers' => 'objectClass=kolabInetOrgPerson', //filter which must validate a user according to RFC4515, i.e. surrounded by brackets
// 'baseDNGroups' => 'ou=divisions,dc=tennaxia,dc=net', //not used ATM
// 'filterGroups' => 'objectClass=groupOfUniqueNames', //not used ATM
/** /!\ "username" should be set and "updated" must be set **/

View File

@ -56,6 +56,10 @@ 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']);
//connect as root
if (!ldap_bind($this->connect,$config['bindDN'],$config['passDN'])){
$c->messages[] = sprintf(i18n( "drivers_ldap : Unable to bind to LDAP, check your bindDN >%s< and passDN >%s< of your configuration or if your server is reachable"),$config['bindDN'],$config['passDN'] );
@ -70,10 +74,10 @@ class ldapDrivers
$this->baseDNGroups = $config['baseDNGroups'];
$this->filterGroups = $config['filterGroups'];
}
/**
* Retrieve all users from the LDAP directory
*/
function getAllUsers($attributs){
global $c;
$entry = ldap_list($this->connect,$this->baseDNUsers,$this->filterUsers,$attributs);