Moodle

Front page level calendar requires login when courses parameter included in URL

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9.5, 2.0
  • Fix Version/s: 1.9.6
  • Component/s: Calendar
  • Labels:
    None
  • Difficulty:
    Easy
  • Affected Branches:
    MOODLE_19_STABLE, MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

The 'Go to calendar...' link in the upcoming events block may require the user to login even when forcelogin is set to false.

When the upcoming calendar block is visible a non-logged in user may see the headings for some upcoming site level calendar items.
Clicking on calendar item titles or dates allows them to view more information, however clicking on 'Go to calendar...' takes them to a login page.

It seems that /calendar/view.php treats these two URLs differently

/calendar/view.php?view=upcoming&course=1 (requires a login before showing site events)

/calendar/view.php?view=upcoming (does not require a login and shows details of site events)

To reproduce in 1.9.5 or 2.0:

1. Set forcelogin to false
2. Set autologin to false
3. Show the upcoming events block
4. Logout and then visit the front page
5. Click on 'Go to calendar...' in the upcoming events block

Suggested change:

/calendar/view.php

Replace
if ($courseid) {
with
if ($courseid && $courseid != SITEID) {

Patch attached for 2.0 and 1.9.5

This allows non-logged in users to view the details of events without logging in, but only when forcelogin has been set to false.

Activity

Hide
Martin Dougiamas added a comment -

Thanks Sean - good analysis!

I've checked your patches in.

Show
Martin Dougiamas added a comment - Thanks Sean - good analysis! I've checked your patches in.
Hide
Andrew Davis added a comment -

nice work. closing.

Show
Andrew Davis added a comment - nice work. closing.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: