MDL-47474 Calendar export: Fix user id in authorization check
authorHenning Bostelmann <henning.bostelmann@york.ac.uk>
Tue, 30 Sep 2014 18:39:29 +0000 (19:39 +0100)
committerHenning Bostelmann <henning.bostelmann@york.ac.uk>
Tue, 30 Sep 2014 18:39:29 +0000 (19:39 +0100)
calendar/export_execute.php

index c502112..9f2700e 100644 (file)
@@ -175,7 +175,7 @@ $ical->add_property('method', 'PUBLISH');
 foreach($events as $event) {
    if (!empty($event->modulename)) {
         $cm = get_coursemodule_from_instance($event->modulename, $event->instance);
-        if (!\core_availability\info_module::is_user_visible($cm, 0, false)) {
+        if (!\core_availability\info_module::is_user_visible($cm, $userid, false)) {
             continue;
         }
     }