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

Auth LDAP does not sync custom fields from LDAP to local moodle DB

    Details

    • Testing Instructions:
      Hide
      Test 1

      You need a LDAP server and to setup the LDAP authentication.

      1. Define user custom profile fields, one for each type.
      2. In LDAP auth settings (in Moodle) specify to match those fields to fields in your LDAP.
        • Notes:
          • For the standard profile fields, make sure to map at least the firstname, lastname and email.
          • For the custom profile fields, you may use the existing user profile attributes in your LDAP server.
          • Make sure that for each of these mapped fields, "Update local" is set to "On every login".
      3. Create some users in LDAP with data in those fields.
        • Some notes about entering values on the LDAP side:
          • For the checkbox profile field type, make sure to set a value of either 0 or 1.
          • For the date/time profile field type, make sure to set a UNIX timestamp value.
          • For the dropdown menu profile field type, make sure to enter a value that was defined in the "Menu options (one per line)" settings.
      4. Run LDAP sync.

        php admin/tool/task/cli/schedule_task.php --execute=\\auth_ldap\\task\\sync_task

      5. Make sure users are created in Moodle and custom fields are filled.
      6. Change a user's field value in LDAP
      7. Run the LDAP sync again.
      8. Make sure users are updated in Moodle and custom fields reflect new value.
      Test 2
      1. Repeat steps 1 - 3 in Test 1.
      2. Log in as a new user on the Moodle site (but existing user in LDAP with details filled out) and confirm the profile fields have been updated.
      3. Log out.
      4. Update the fields on the LDAP server for the user.
      5. Log in as the user again and confirm the profile fields have been updated.
      Test 3 (master only)

      You need to set up an external database and setup the DB authentication with 'Update users' set to 'Yes'.

      1. Define user custom profile fields, one of each type. (or you may use the same custom profile fields in the first test)
      2. In DB auth settings (in Moodle) specify to match those fields to fields in your external DB.
        • Notes:
          • For the standard profile fields, make sure to map at least the firstname, lastname and email.
          • Make sure that for each of these mapped fields, "Update local" is set to "On every login".
      3. Create a user in the external db with data in those fields.
      4. Run DB sync.

        php admin/tool/task/cli/schedule_task.php --execute=\\auth_db\\task\\sync_users

      5. Make sure the user is created in Moodle and custom fields are filled.
      6. Update the values in the external db to something different.
      7. Run DB sync.
      8. Confirm the custom user profile fields were updated.
      Show
      Test 1 You need a LDAP server and to setup the LDAP authentication. Define user custom profile fields, one for each type. In LDAP auth settings (in Moodle) specify to match those fields to fields in your LDAP. Notes: For the standard profile fields, make sure to map at least the firstname, lastname and email. For the custom profile fields, you may use the existing user profile attributes in your LDAP server. Make sure that for each of these mapped fields, " Update local " is set to "On every login". Create some users in LDAP with data in those fields. Some notes about entering values on the LDAP side: For the checkbox profile field type, make sure to set a value of either 0 or 1. For the date/time profile field type, make sure to set a UNIX timestamp value. For the dropdown menu profile field type, make sure to enter a value that was defined in the " Menu options (one per line) " settings. Run LDAP sync. php admin/tool/task/cli/schedule_task.php --execute=\\auth_ldap\\task\\sync_task Make sure users are created in Moodle and custom fields are filled. Change a user's field value in LDAP Run the LDAP sync again. Make sure users are updated in Moodle and custom fields reflect new value. Test 2 Repeat steps 1 - 3 in Test 1. Log in as a new user on the Moodle site (but existing user in LDAP with details filled out) and confirm the profile fields have been updated. Log out. Update the fields on the LDAP server for the user. Log in as the user again and confirm the profile fields have been updated. Test 3 (master only) You need to set up an external database and setup the DB authentication with 'Update users' set to 'Yes'. Define user custom profile fields, one of each type. (or you may use the same custom profile fields in the first test) In DB auth settings (in Moodle) specify to match those fields to fields in your external DB. Notes: For the standard profile fields, make sure to map at least the firstname, lastname and email. Make sure that for each of these mapped fields, " Update local " is set to "On every login". Create a user in the external db with data in those fields. Run DB sync. php admin/tool/task/cli/schedule_task.php --execute=\\auth_db\\task\\sync_users Make sure the user is created in Moodle and custom fields are filled. Update the values in the external db to something different. Run DB sync. Confirm the custom user profile fields were updated.
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_31_STABLE, MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE
    • Pull from Repository:
    • Pull 3.3 Branch:
    • Pull 3.4 Branch:
    • Pull Master Branch:
      MDL-40613_master

      Description

      Good Morning

      I have noticed that the mapping of LDAP fields to custom profile fields has been added in 2.6 - FANTASTIC!!

      I would like to know however - if I map a users account expiry to a date/time field in Moodle, why doesnt it map!

      Its not an LDAP permissions problem, as I have used a full domain admin account, which can see the information using ADExplorer, but its not imported into Moodle when I LDAP Sync...

      Could this be added please?

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  28 Vote for this issue
                  Watchers:
                  29 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    15/Jan/18