Skip to content

Commit

Permalink
Fixed issue #9035: LDAP-search and bind not working with MS ActiveDir…
Browse files Browse the repository at this point in the history
…ectory

Dev: AD needs referrals disabled. Added option in
Dev: plugin settings
  • Loading branch information
mfaber committed May 19, 2014
1 parent b3674c5 commit a1aebd6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions application/core/plugins/AuthLDAP/AuthLDAP.php
Expand Up @@ -30,6 +30,11 @@ class AuthLDAP extends AuthPluginBase
'default' => '2',
'submitonchange'=> true
),
'ldapoptreferrals' => array(
'type' => 'boolean',
'label' => 'Select true if referrals must be followed (use false for ActiveDirectory)',
'default' => '0'
),
'ldaptls' => array(
'type' => 'boolean',
'label' => 'Check to enable Start-TLS encryption When using LDAPv3',
Expand Down Expand Up @@ -152,6 +157,7 @@ public function getPluginSettings($getValues = true)
unset($aPluginSettings['extrauserfilter']);
unset($aPluginSettings['binddn']);
unset($aPluginSettings['bindpwd']);
unset($aPluginSettings['ldapoptreferrals']);
}
}

Expand All @@ -178,6 +184,7 @@ public function newUserSession()
$ldapport = $this->get('ldapport');
$ldapver = $this->get('ldapversion');
$ldaptls = $this->get('ldaptls');
$ldapoptreferrals = $this->get('ldapoptreferrals');
$ldapmode = $this->get('ldapmode');
$suffix = $this->get('domainsuffix');
$prefix = $this->get('userprefix');
Expand Down Expand Up @@ -207,6 +214,7 @@ public function newUserSession()
$ldapver = 2;
}
ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, $ldapver);
ldap_set_option($ldapconn, LDAP_OPT_REFERRALS, $ldapoptreferrals);

if (!empty($ldaptls) && $ldaptls == '1' && $ldapver == 3 && preg_match("/^ldaps:\/\//", $ldapserver) == 0 )
{
Expand Down

0 comments on commit a1aebd6

Please sign in to comment.