Hi Haqa,
I have went through your code, and added
PHP Code:
// Disable LDAP referrals option
ldap_set_option($ldapConnection, LDAP_OPT_REFERRALS, 0);
under your code
PHP Code:
// Enable LDAP version 3
ldap_set_option($ldapConnection, LDAP_OPT_PROTOCOL_VERSION, 3);
and change your LDAP bind code like this
PHP Code:
// Bind (authenticate or anonymous depending on settings
//if ($vbulletin->options['ldap_anon_bind']) {
// $ldap_bind = ldap_bind($ldapConnection);
//} else {
// $ldap_bind = ldap_bind($ldapConnection, $vbulletin->options['ldap_bind_dn'], $vbulletin->options['ldap_bind_password']);
//}
$ldap_bind = ldap_bind($ldapConnection, $vbulletin->GPC['vb_login_username'], $passwd);
I could ignore your "ldap_anon_bind", "ldap_bind_dn" and "ldap_bind_password" options.
Now, I can get it work with my vBulletin 3.7.6, but I got the same problem with
n0manarmy , that's when a domain user login for the first time, it returns "
password error" message, when login for the next time, third time, etc., it's ok.
In my poinion, the reason I got this problem is the position of the hook "
global_complete", what do you think? Thanks!