MDL-41317 Set correct context to send bulk message page
authorMarina Glancy <marina@moodle.com>
Mon, 26 Aug 2013 07:41:43 +0000 (17:41 +1000)
committerMarina Glancy <marina@moodle.com>
Mon, 26 Aug 2013 07:41:43 +0000 (17:41 +1000)
user/messageselect.php

index 6143521..a9d6023 100644 (file)
@@ -58,13 +58,12 @@ if ($deluser !== 0) {
     $url->param('deluser', $deluser);
 }
 $PAGE->set_url($url);
-$PAGE->set_context(context_system::instance());
 
 if (!$course = $DB->get_record('course', array('id'=>$id))) {
     print_error('invalidcourseid');
 }
 
-require_login();
+require_login($course);
 
 $coursecontext = context_course::instance($id);   // Course context
 $systemcontext = context_system::instance();   // SYSTEM context