Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-15799

LDAP - user data mapping doesn't work

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.9.1
    • 1.8.7, 1.9.3, 2.0
    • Authentication
    • 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

    Description

      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.

      Attachments

        Activity

          People

            iarenaza Iñaki Arenaza
            victorf victorf
            David Woloszyn, Huong Nguyen, Jake Dallimore, Michael Hawkins, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              15/Oct/08