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

Automatically populate updated values in $USER when user_update_user is called

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.8.5, 3.1.2, 3.2
    • Fix Version/s: None
    • Component/s: User management
    • Labels:
    • Affected Branches:
      MOODLE_28_STABLE, MOODLE_31_STABLE, MOODLE_32_STABLE

      Description

      I've revised this issue a little from the original description:

      Steps to reproduce:

      1. Login as an admin and student in two different browser windows
      2. As admin edit the student's profile - change the firstname, to add a '1' to the end of it
      3. As the student go to profile

      Expected results:

      1. The users firstname should be the same in both the user menu and the profile pages

      Actual results:

      1. The user menu ($USER) displays out of date information

      This is a fairly niche issue, however it might have more serious consequences if $USER gets too far out of date. Note that we have manual workarounds for this in user/edit.php for the currently logged in user.


      Original description:

      As seen in MDL-50162, when a user edits their own profile/properties we need to manually update the $USER object which is stored in the session. Failing to do so appears as if the value wasn't changed.

      This can also potentially be a security concern as an admin that would update a field from another use who's currently logged in will not see the change happening.

      I suggest we either:

      1. Invalid the cache in the session
      2. Implement auto update in user_update_user

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated: