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

Incorrect user deletes and updates in ims enterprise auth plugin

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      1/ execute phpunit tests in 25 and master branches
      2/ test enrol_meta cli sync in all affected branches (<= 24)
      3/ test imsenterprise user creating and deleting in all branches
      4/ edit deleted flag for some users directly in database
      5/ execute the new admin/cli/fix_deleted_users.php script and verify the users were deleted properly (this means the username and idnumber should be cleaned and user data like role_assignments deleted).

      Show
      1/ execute phpunit tests in 25 and master branches 2/ test enrol_meta cli sync in all affected branches (<= 24) 3/ test imsenterprise user creating and deleting in all branches 4/ edit deleted flag for some users directly in database 5/ execute the new admin/cli/fix_deleted_users.php script and verify the users were deleted properly (this means the username and idnumber should be cleaned and user data like role_assignments deleted).
    • Affected Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w22_MDL-39802_m26_deletedusers

      Description

      I've noticed a bug when enrolling deleted users via a meta enrolment.

      Consider user U in course A, enrolled as a manual enrolment and the user account is all ok.

      For some reason, user U's account becomes marked as deleted.
      (in our setup, users are added via the LDAP enrolment plugin, set to "Keep internal" if the external user disappears)

      If you then go to course B and add a meta enrolment back to course A (ie. those in course A are also enroled in course B), the procedure fails. The meta plugin only adds a subset of users to course A, and diplays the following error:

      Coding error detected, it must be fixed by a programmer: User ID does not exist or is deleted!

      More information about this error
      Debug info: userid:68583
      Error code: codingerror
      Stack trace:

      line 1610 of /lib/accesslib.php: coding_exception thrown
      line 1311 of /lib/enrollib.php: call to role_assign()
      line 465 of /enrol/meta/locallib.php: call to enrol_plugin->enrol_user()
      line 56 of /enrol/meta/addinstance.php: call to enrol_meta_sync()

      Final note. I can see why this occurs, Moodle can't find the user account in order to add them to the second course. But IMHO Moodle should continue to add the valid users and display a summary/error at the end of the procedure; rather than aborting in a semi-enrolled state.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  8/Jul/13