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

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

    XMLWordPrintable

Details

    • MOODLE_30_STABLE, MOODLE_31_STABLE, MOODLE_32_STABLE, MOODLE_33_STABLE
    • MOODLE_34_STABLE, MOODLE_35_STABLE
    • MDL_56093
    • Hide
      1. Create custom user profie fields of type:
        1. checkbox (Shortname suspended)
        2. datetime (date only) (Shortname dob)
        3. textinput (Shortname broomstick)
      2. create a new Postgres database and import the attached create.sql
      3. Set up authentication plugin auth_db pointing to this database, ensuring that the following fields are set:
        1. Username (fielduser): uid
        2. Password field (fieldpass): uid
        3. First name (field_map_firstname): firstname
        4. Last name (field_map_lastname): lastname
        5. Email (field_map_email): email
        6. Data mapping (suspended) (field_map_profile_field_suspended): suspended
        7. Data mapping (dob) (field_map_profile_field_dob): dob
        8. Update local (dob) (field_updatelocal_profile_field_dob): "On every login"
        9. Data mapping (broomstick) (field_map_profile_field_broomstick): broomstick
        10. Update local (broomstick) (field_updatelocal_profile_field_broomstick): "On every login"
        11. Update external (broomstick) (field_updateremote_prfile_field_broomstick): "On update"
      4. On "Manage authentication plugins" page open the "Test settings" page for auth_db, they should be ok
        1. Confirm that it appears correctly and found all of the fields
      5. Open the CLI and run the auth_db sync task:

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

      6. Go to Site administration => Users => Browse list of users
      7. Find the profile for "Harry Potter" and open the profile editor
        1. Confirm that the first name was "Harry"
        2. Confirm that the last name was "Potter"
        3. Confirm that the email was "harry.potter@example.com"
        4. Confirm that the dob was set
        5. Confirm that the suspended was set to "2"
        6. Confirm that the broomstick was set to "Dusty"
      8. Update the broomstick name to "Colin"
      9. View the contents of the extusers table in the external database:
        1. Confirm that the broomstick value was updated for Harry
      10. Update the name of Harry's broomstick in the external database and set it to "Bernard"
      11. Log in as Harry
        • username: potterh
        • password: potterh
      12. View the profile page
        1. *Confirm that the broomstick value was updated to "Bernard"
      Show
      Create custom user profie fields of type: checkbox (Shortname suspended ) datetime (date only) (Shortname dob ) textinput (Shortname broomstick ) create a new Postgres database and import the attached create.sql Set up authentication plugin auth_db pointing to this database, ensuring that the following fields are set: Username ( fielduser ): uid Password field ( fieldpass ): uid First name ( field_map_firstname ): firstname Last name ( field_map_lastname ): lastname Email ( field_map_email ): email Data mapping (suspended) ( field_map_profile_field_suspended ): suspended Data mapping (dob) ( field_map_profile_field_dob ): dob Update local (dob) ( field_updatelocal_profile_field_dob ): "On every login" Data mapping (broomstick) ( field_map_profile_field_broomstick ): broomstick Update local (broomstick) ( field_updatelocal_profile_field_broomstick ): " On every login " Update external (broomstick) ( field_updateremote_prfile_field_broomstick ): " On update " On "Manage authentication plugins" page open the " Test settings " page for auth_db, they should be ok Confirm that it appears correctly and found all of the fields Open the CLI and run the auth_db sync task: php admin/tool/task/cli/schedule_task.php --execute="\auth_db\task\sync_users" Go to Site administration => Users => Browse list of users Find the profile for " Harry Potter " and open the profile editor Confirm that the first name was " Harry " Confirm that the last name was " Potter " Confirm that the email was " harry.potter@example.com " Confirm that the dob was set Confirm that the suspended was set to " 2 " Confirm that the broomstick was set to " Dusty " Update the broomstick name to " Colin " View the contents of the extusers table in the external database: Confirm that the broomstick value was updated for Harry Update the name of Harry's broomstick in the external database and set it to " Bernard " Log in as Harry username: potterh password: potterh View the profile page *Confirm that the broomstick value was updated to " Bernard "

    Description

      Expected: field matching would sync fields both ways
      Actual: field matching only syncs fields internally to external DB

      1. setup auth_db with external db
      2. set up field matching in settings
      3. run cron

      I have actually done the work required to get this working, so I was more or less putting this out there to know what the next steps are, or if I have completely misunderstood something about the plugin.

      Attachments

        Issue Links

          Activity

            People

              b.wolf82 Benjamin Wolf
              jlowe64 Jerrett Fowler
              Carlos Escobedo Carlos Escobedo
              Andrew Lyons Andrew Lyons
              Ryan Wyllie Ryan Wyllie
              Votes:
              9 Vote for this issue
              Watchers:
              16 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                10/Sep/18