Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fix for MDL-10112 bulk messaging fails silently when messaging not en…

…abled
  • Loading branch information...
commit a8fbb9b4cd8ad48336ae5989dbd420d911e0c0c7 1 parent cfc673c
toyomoyo authored

Showing 2 changed files with 6 additions and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  user/index.php
  2. +5 0 user/messageselect.php
2  user/index.php
@@ -597,7 +597,7 @@ function checkchecked(form) {
597 597 echo '<input type="button" onclick="checknone()" value="'.get_string('deselectall').'" /> ';
598 598 $displaylist = array();
599 599 // fix for MDL-8885, only show this if user has capability
600   - if (has_capability('moodle/site:readallmessages', $context)) {
  600 + if (has_capability('moodle/site:readallmessages', $context) && !empty($CFG->messaging)) {
601 601 $displaylist['messageselect.php'] = get_string('messageselectadd');
602 602 }
603 603 if ($course->enrolperiod) {
5 user/messageselect.php
@@ -18,6 +18,11 @@
18 18
19 19 require_login();
20 20 require_capability('moodle/site:readallmessages', get_context_instance(CONTEXT_COURSE, $id));
  21 +
  22 + // fix for MDL-10112
  23 + if (empty($CFG->messaging)) {
  24 + error("Messaging is disabled on this site");
  25 + }
21 26
22 27 if (empty($SESSION->emailto)) {
23 28 $SESSION->emailto = array();

0 comments on commit a8fbb9b

Please sign in to comment.
Something went wrong with that request. Please try again.