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

    • MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE
    • MOODLE_26_STABLE, MOODLE_27_STABLE
    • 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.

      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

            nmagill Neill Magill
            nmagill Neill Magill
            Andrew Davis Andrew Davis
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Jason Fowler Jason Fowler
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.