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

Error when a not authentified user access to a profile and the configuration doesn't allow it

XMLWordPrintable

    • MOODLE_401_STABLE
    • MOODLE_401_STABLE, MOODLE_402_STABLE
    • MDL-79370-401
    • Hide
      1. Log in as admin
      2. Navigate to Plugins > Authentication > Manage authentication in site administration
      3. Ensure Guest login button is set to Show
      4. Navigate to General > Security > Site security settings in site administration
      5. Ensure Force users to log in for profiles is enabled
      6. Log out
      7. Navigate to Log in page
      8. Press Access as a guest
      9. Manually navigate to the admin profile URL:

        <WWWROOT>/user/profile.php?id=2
        

      10. Confirm there is no debugging about This page did not call $PAGE->set_url(...)
      11. Press Continue
      12. Log in as admin
      13. Confirm you are redirected to admin profile URL after log in
      Show
      Log in as admin Navigate to Plugins > Authentication > Manage authentication in site administration Ensure Guest login button is set to Show Navigate to General > Security > Site security settings in site administration Ensure Force users to log in for profiles is enabled Log out Navigate to Log in page Press Access as a guest Manually navigate to the admin profile URL: <WWWROOT>/user/profile.php?id=2 Confirm there is no debugging about This page did not call $PAGE->set_url(...) Press Continue Log in as admin Confirm you are redirected to admin profile URL after log in
    • 1
    • Team Hedgehog 2023 Sprint 3.2

      When a not authentifaced user try to access to a user profile they've an error

      AH01071: Got error 'PHP message: PHP Notice:  This page did not call $PAGE->set_url(...). 

       

      the bug is in the file /user/profile.php at these point

      if (isguestuser()) {
              $PAGE->set_context(context_system::instance());
              echo $OUTPUT->header();

       

      To solve it I move these lines
      $userid = $userid ? $userid : $USER->id;       // Owner of the page.

      // Even if the user didn't supply a userid, we treat page URL as if they did; this is needed
      // so navigation works correctly.
      $PAGE->set_url('/user/profile.php', ['id' => $userid]);

       

      to line (before the sguestuser()) 45.

            pholden Paul Holden
            aloisiusgunnulf@gmail.com Dominique Palumbo
            Meirza Meirza
            Huong Nguyen Huong Nguyen
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 16 minutes
                1h 16m

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