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

Customise this page button on user profile page only works correctly for users own profile

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Setup:

      • Create a user who has the capability to edit user profiles, for example the site admin (User A)
      • Create another user (User B)

      What should happen:

      • Login as User A
      • Visit the profile page of User B
      • Click on the 'Customise this page' button
      • User B's profile page should be loaded with editing turned on.
      • Add a block to the page
      • Verify that the block shows up.
      • Verify the IP lookup is performed for user B.
      • Verify the "Reset page to default" option (available after applying for a customization) maintains the user B tracked, not jumping back to user A at all.
      Show
      Setup: Create a user who has the capability to edit user profiles, for example the site admin (User A) Create another user (User B) What should happen: Login as User A Visit the profile page of User B Click on the 'Customise this page' button User B's profile page should be loaded with editing turned on. Add a block to the page Verify that the block shows up. Verify the IP lookup is performed for user B. Verify the "Reset page to default" option (available after applying for a customization) maintains the user B tracked, not jumping back to user A at all.
    • Affected Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      If a user has the capability to edit a profile page of another user and hits the 'Customise this page' button they are taken to their own profile page rather than the profile page of the user they clicked the 'Customise this page' button on.

      How to reproduce:

      Setup:

      • Create a user who has the capability to edit user profiles, for example the site admin (User A)
      • Create another user (User B)

      Steps to cause the failure:

      • Login as User A
      • Visit the profile page of User B
      • Click on the 'Customise this page' button
      • User A's profile page will be loaded with editing turned on.

      What should happen:

      • Login as User A
      • Visit the profile page of User B
      • Click on the 'Customise this page' button
      • User B's profile page should be loaded with editing turned on.

      The cause
      This is happening because the customise this page button's form is not passing the id parameter.

      It can be fixed by adding the following the params array to line 177 of profile.php:

      'id' => $userid

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                14/Jul/14