Moodle
  1. Moodle
  2. MDL-1957

Calendar on front page shows events from all courses to all students

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.4.1
    • Fix Version/s: None
    • Component/s: Calendar
    • Labels:
      None
    • Environment:
      All
    • Affected Branches:
      MOODLE_14_STABLE
    • Rank:
      10429

      Description

      Did this just happen recently? As a student on moodle.org, for example, you can see events happening in all courses, even ones you're not enrolled in ... that's not right, surely?

      Students and teachers should only see events from courses they are enrolled in ....

        Activity

        Hide
        Martin Dougiamas added a comment -

        From Martin Dougiamas (martin at moodle.com) Saturday, 18 September 2004, 08:59 PM:

        The way to tell this is to look at the $USER->student and $USER->teacher arrays ...

        From Martin Dougiamas (martin at moodle.com) Saturday, 18 September 2004, 09:14 PM:

        Fixed in CVS.

        From Martin Dougiamas (martin at moodle.com) Sunday, 19 September 2004, 12:04 PM:

        Something like this near the top of calendar_set_filters() ?

        if($courseeventsfrom === NULL) {

        if (isset($USER) && isset($USER->realuser))

        { $courseeventsfrom = calendar_get_default_courses(true); // Get new course list for current user }

        else

        { $courseeventsfrom = $SESSION->cal_courses_shown; }

        }

        if($groupeventsfrom === NULL) {

        if (isset($USER) && isset($USER->realuser))

        { $groupeventsfrom = calendar_get_default_courses(true); // Get new course list for current user }

        else

        { $groupeventsfrom = $SESSION->cal_courses_shown; }

        }

        I'm just a bit worried about all the other SESSION variables that are present at this time ... should they be dealt with too? Should all this be done in calendar_session_vars() instead?

        From Jon Papaioannou (pj at moodle.org) Monday, 20 September 2004, 06:22 AM:

        Yep, calendar_session_vars() is the place to fix it in. As simple as 1-2-3 in retrospect. I 've put this into both MOODLE_14 and HEAD, undoing your last block changes in the process.

        Give it a shot and bug me again if there's a problem (which I doubt)

        From Martin Dougiamas (martin at moodle.com) Monday, 20 September 2004, 09:45 AM:

        Looks good to me! Thanks!

        Show
        Martin Dougiamas added a comment - From Martin Dougiamas (martin at moodle.com) Saturday, 18 September 2004, 08:59 PM: The way to tell this is to look at the $USER->student and $USER->teacher arrays ... From Martin Dougiamas (martin at moodle.com) Saturday, 18 September 2004, 09:14 PM: Fixed in CVS. From Martin Dougiamas (martin at moodle.com) Sunday, 19 September 2004, 12:04 PM: Something like this near the top of calendar_set_filters() ? if($courseeventsfrom === NULL) { if (isset($USER) && isset($USER->realuser)) { $courseeventsfrom = calendar_get_default_courses(true); // Get new course list for current user } else { $courseeventsfrom = $SESSION->cal_courses_shown; } } if($groupeventsfrom === NULL) { if (isset($USER) && isset($USER->realuser)) { $groupeventsfrom = calendar_get_default_courses(true); // Get new course list for current user } else { $groupeventsfrom = $SESSION->cal_courses_shown; } } I'm just a bit worried about all the other SESSION variables that are present at this time ... should they be dealt with too? Should all this be done in calendar_session_vars() instead? From Jon Papaioannou (pj at moodle.org) Monday, 20 September 2004, 06:22 AM: Yep, calendar_session_vars() is the place to fix it in. As simple as 1-2-3 in retrospect. I 've put this into both MOODLE_14 and HEAD, undoing your last block changes in the process. Give it a shot and bug me again if there's a problem (which I doubt) From Martin Dougiamas (martin at moodle.com) Monday, 20 September 2004, 09:45 AM: Looks good to me! Thanks!
        Hide
        Michael Blake added a comment -

        Temporary transition to reassign bug to "pj".

        Show
        Michael Blake added a comment - Temporary transition to reassign bug to "pj".
        Hide
        Michael Blake added a comment -

        Re-closing bugs after re-assigning to "pj".

        Show
        Michael Blake added a comment - Re-closing bugs after re-assigning to "pj".

          People

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

            Dates

            • Created:
              Updated:
              Resolved: