MRSB – Sistema di prenotazione aule active directory windows server 2003 R2

first of all, i'm sorry for my bad english!

I solved some problem occurred in ldap authentication with ADS Windows
2003 R2.

i've changed: in this manner:

function authValidateUser($user, $pass)
global $auth;
global $ldap_host;
global $ldap_base_dn;
global $ldap_user_attrib;
global $ldap_filter;
global $account_suffix; // <——- added LINE 26

// establish ldap connection
// the '@' suppresses errors
$ldap = @ldap_connect($ldap_host);
ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3); // <——– Added
line 77
ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0); //disable plain text
passwords // <——— Added line 78

// Check that connection was established

//if(@ldap_bind($ldap, $dn, $pass)) // <—- changed line 92 from …
if(@ldap_bind($ldap, $user.$account_suffix, $pass)) // <— … to

i've configured
like this:

# Where is the LDAP server
$ldap_host = "";
$ldap_base_dn = "cn=users, dc=pippo, dc=local";
$account_suffix = "@pippo.local";
$ldap_user_attrib = "sAMAccountName";

In the follow line there was an error …
#//$ldap_user_filter =

this is correct
$ldap_filter =

I hope someone can use this information to solve same problem.
Good bye.

mrbs is a very good program!!!

Related Posts