diff --git a/config/example-config.php b/config/example-config.php index 386f29a3..c31f83fe 100644 --- a/config/example-config.php +++ b/config/example-config.php @@ -691,6 +691,12 @@ $c->admin_email = 'calendar-admin@example.com'; // 'bindDN' => 'cn=calendar-manager,ou=users,dc=example,dc=net', // 'passDN' => 'xxxxxxxx', +// /* Perform a SASL bind (usually EXTERNAL/GSSAPI) instead of a +// * simple bind. Enalbe this if you would like to authenticate to +// * the LDAP server using Kerberos credentials. +// */ +// 'sasl' => 'yes', // perform a sasl bind + // 'protocolVersion' => '3', // version of LDAP protocol to use // 'optReferrals' => 0, // whether to automatically follow referrals // // returned by the LDAP server @@ -773,6 +779,7 @@ $c->admin_email = 'calendar-admin@example.com'; // $c->authenticate_hook['config'] = array( // 'host' => 'ldap://ldap.example.net', // 'port' => '389', // usually 636 for ldaps +// 'sasl' => 'yes', // 'bindDN' => 'cn=bind-user,cn=Users,dc=example,dc=net', // 'passDN' => 'secret', // 'baseDNUsers' => 'dc=example,dc=net', diff --git a/inc/drivers_ldap.php b/inc/drivers_ldap.php index 754dac31..447e9fd9 100644 --- a/inc/drivers_ldap.php +++ b/inc/drivers_ldap.php @@ -118,7 +118,8 @@ class ldapDriver //ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7); //connect as root - if (!ldap_bind($this->connect, (isset($config['bindDN']) ? $config['bindDN'] : null), (isset($config['passDN']) ? $config['passDN'] : null) ) ){ + $bind_func = isset($config['sasl']) ? 'ldap_sasl_bind' : 'ldap_bind'; + if (!$bind_func($this->connect, (isset($config['bindDN']) ? $config['bindDN'] : null), (isset($config['passDN']) ? $config['passDN'] : null) ) ){ $bindDN = isset($config['bindDN']) ? $config['bindDN'] : 'anonymous'; $passDN = isset($config['passDN']) ? $config['passDN'] : 'anonymous';