meeting-room-booking-system / mrbs-code

MRBS application code
Other
121 stars 59 forks source link

ldap user search and $ldap_filter not working #422

Closed jberanek closed 1 year ago

jberanek commented 13 years ago

Hi

i am having some trouble with the rewritten ldap user search part in auth_ldap.inc. With $ldap_debug turned on, i get the log messages:

authValidateUserCallback: Successful authenticated bind checking
authValidateUserCallback: No entry found with filter

I skimmed the noisy part, followed by 'Unknown User' on the frontend. Disabling $ldap_filter the authentication works, but there is no filtering. Running ldapsearch 'distinguishedName=uid=admin,ou=users...' like produced by mrbs 1.4.6, i get no result entry, however ldapsearch 'uid=admin' (1.4.1) runs just fine.

I wrote i temporary patch revoking the change, but i am wondering if there is another way round?

mrbs version => 1.4.6 dpkg -l slapd => 2.4.9-0ubuntu0.8.04.1 php --version => PHP 5.2.4-2ubuntu5.4

Reported by: doe418

Original Ticket: mrbs/bugs/213

jberanek commented 13 years ago

By any chance do you have users with commas in their CN? I have found the $user_search value generated does not work for users with commas.

To test if this is the problem add the following to top of authValidateUserCallback function:

global $ldap_dn_search_attrib; $user_search = "$ldap_dn_search_attrib = $user";

If that works you will also need to add it to authLdapGetEmailCallback for email to work. I'm unsure why $user_search does not work but is likely due to escaping of comma or escaping of backslash before comma.

$user_search = "distinguishedName=" . $dn;

Original comment by: rudd_j

jberanek commented 13 years ago

Please try the latest SVN version which includes the auth_ldap.php patch I submitted.

Original comment by: rudd_j

jberanek commented 12 years ago

This should be fixed in the latest version, as James as said.

Original comment by: jberanek