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

Not enrolled users can be subscribed to forum

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Deferred
    • Affects Version/s: 2.1, 2.2
    • Fix Version/s: None
    • Component/s: Forum
    • Labels:
      None
    • Testing Instructions:
      Hide

      Testing difficulty: moderate

      1. Login as admin
      2. Write down the IDs of two users (not the admin user)
      3. Enrol one of this user in a course
      4. Create a forum with optional subscription
      5. Visit the following URL (/mod/forum/subscribe.php?id=&sesskey=&user=) making sure you:
        • Update the id variable with your forum id
        • Update the sesskey with yours
        • Set the user variable to the user id of the enrolled user
      6. The following page confirms that the user has been subscribed
      7. Now visit the same URL but change the user id with the one of the user that is not enrolled in the course
      8. An error occurs preventing the user to be subscribed
      Show
      Testing difficulty: moderate Login as admin Write down the IDs of two users (not the admin user) Enrol one of this user in a course Create a forum with optional subscription Visit the following URL (/mod/forum/subscribe.php?id=&sesskey=&user=) making sure you: Update the id variable with your forum id Update the sesskey with yours Set the user variable to the user id of the enrolled user The following page confirms that the user has been subscribed Now visit the same URL but change the user id with the one of the user that is not enrolled in the course An error occurs preventing the user to be subscribed
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE

      Description

      When subscribing a user to a forum, the permissions to subscribe to the forum are tested against the current user, not the target one.

      Before fixing, following the test instructions will fail at step 5 because the admin user is not enrolled in the course.

      See mod/forum/subscribe.php:83 and linked issue.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              lucaboesch Luca Bösch
              Reporter:
              fred Frédéric Massart
              Participants:
              Component watchers:
              Andrew Nicols, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: