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

Automatically populate updated values in $USER when user_update_user is called



    • 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:


      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


          Issue Links



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


                • Created: