-
Bug
-
Resolution: Fixed
-
Major
-
1.9.1
-
None
-
Moodle on Windows 2003 server, ldaps connection agains a remote IBM LDAP server.
-
MySQL
-
MOODLE_19_STABLE
-
MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE
After configuring the LDAPS connetion, with the PEM certificate, the data mapping of the user doesn't work. So after succesful login the username, surname, email... should be mapped to the user profile, but all fields are empty. After trying a lot with the parameters and checking the code I found a posible bug in the file \moodle\auth\ldap\auth.php
Changing the next two lines it works fine:
186 if (!$user_info_result = ldap_read($ldapconnection, $user_dn, $this->config->objectclass, $search_attribs)) {
if (!$user_info_result = ldap_read($ldapconnection, $user_dn, '(objectClass=*)', $search_attribs)) {
1057 $user_info_result = ldap_read($ldapconnection, $user_dn, $this->config->objectclass, $search_attribs);
$user_info_result = ldap_read($ldapconnection, $user_dn, '(objectClass=*)', $search_attribs);
The 3rd parameter of the funtion should be "objectClass=" or "uid=", etc. But $this->config->objectclass could be empty or be something like "uid" or "cn".
I don't know how it could work this way for other people or if there is a configuration combination to avoid this. Anyway for me it works with this fix.
Victor.