diff --git a/config/example-config.php b/config/example-config.php index 4948be68..b731e2a0 100644 --- a/config/example-config.php +++ b/config/example-config.php @@ -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 **/ diff --git a/inc/drivers_ldap.php b/inc/drivers_ldap.php index dd186c20..65b9ee30 100644 --- a/inc/drivers_ldap.php +++ b/inc/drivers_ldap.php @@ -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);