mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-07-28 13:09:24 +00:00
Allow for the LDAP protocol version to be defined.
This commit is contained in:
parent
703f09adfb
commit
f9bf7ff170
@ -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 **/
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user