Skip to content
Browse files

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

…abled
  • Loading branch information...
1 parent cfc673c commit a8fbb9b4cd8ad48336ae5989dbd420d911e0c0c7 toyomoyo committed Jun 14, 2007
Showing with 6 additions and 1 deletion.
  1. +1 −1 user/index.php
  2. +5 −0 user/messageselect.php
View
2 user/index.php
@@ -597,7 +597,7 @@ function checkchecked(form) {
echo '<input type="button" onclick="checknone()" value="'.get_string('deselectall').'" /> ';
$displaylist = array();
// fix for MDL-8885, only show this if user has capability
- if (has_capability('moodle/site:readallmessages', $context)) {
+ if (has_capability('moodle/site:readallmessages', $context) && !empty($CFG->messaging)) {
$displaylist['messageselect.php'] = get_string('messageselectadd');
}
if ($course->enrolperiod) {
View
5 user/messageselect.php
@@ -18,6 +18,11 @@
require_login();
require_capability('moodle/site:readallmessages', get_context_instance(CONTEXT_COURSE, $id));
+
+ // fix for MDL-10112
+ if (empty($CFG->messaging)) {
+ error("Messaging is disabled on this site");
+ }
if (empty($SESSION->emailto)) {
$SESSION->emailto = array();

0 comments on commit a8fbb9b

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