merged fix for MDL-10112 bulk messaging fails silently when messaging not enabled

This commit is contained in:
toyomoyo 2007-06-14 04:41:33 +00:00
parent 783fbd2234
commit 8205423030
2 changed files with 6 additions and 1 deletions

View File

@ -594,7 +594,7 @@
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');
}

View File

@ -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();