Issue Details (XML | Word | Printable)

Key: MDL-15799
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Iñaki Arenaza
Reporter: victorf
Votes: 0
Watchers: 2
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

LDAP - user data mapping doesn't work

Created: 23/Jul/08 10:15 PM   Updated: 25/Aug/08 04:49 AM
Return to search
Component/s: Authentication
Affects Version/s: 1.9.1
Fix Version/s: 1.8.7, 1.9.3, 2.0

File Attachments: None
Image Attachments:

1. snap.jpg
(102 kB)
Environment: Moodle on Windows 2003 server, ldaps connection agains a remote IBM LDAP server.

Database: MySQL
Participants: Iñaki Arenaza, Petr Skoda and victorf
Security Level: None
Resolved date: 25/Aug/08
Affected Branches: MOODLE_19_STABLE
Fixed Branches: MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE


 Description  « Hide
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.



 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
victorf made changes - 22/Aug/08 11:13 PM
Field Original Value New Value
Attachment snap.jpg [ 14943 ]
Petr Skoda made changes - 23/Aug/08 02:24 AM
Assignee Petr Skoda [ skodak ] Iñaki Arenaza [ iarenaza ]
Iñaki Arenaza made changes - 25/Aug/08 04:49 AM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 1.9.3 [ 10290 ]
Fix Version/s 2.0 [ 10122 ]
Fix Version/s 1.8.7 [ 10291 ]