Permalink
Browse files

MDL-28549 navigation: Added a missing login check when adding the cal…

…endar link to the navigation
  • Loading branch information...
1 parent b77088c commit e7f9b7abc8a2a352a8d91c369416dd2b4df98a2f Sam Hemelryk committed Oct 5, 2011
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/navigationlib.php
View
@@ -2319,9 +2319,11 @@ public function add_front_page_course_essentials(navigation_node $coursenode, st
$coursenode->add(get_string('tags', 'tag'), new moodle_url('/tag/search.php'));
}
- // Calendar
- $calendarurl = new moodle_url('/calendar/view.php', array('view' => 'month'));
- $coursenode->add(get_string('calendar', 'calendar'), $calendarurl, self::TYPE_CUSTOM, null, 'calendar');
+ if (isloggedin()) {
+ // Calendar
+ $calendarurl = new moodle_url('/calendar/view.php', array('view' => 'month'));
+ $coursenode->add(get_string('calendar', 'calendar'), $calendarurl, self::TYPE_CUSTOM, null, 'calendar');
+ }
// View course reports
if (has_capability('moodle/site:viewreports', $this->page->context)) { // basic capability for listing of reports

0 comments on commit e7f9b7a

Please sign in to comment.