Permalink
Browse files

MDL-30260 messaging: backporting changes to prevent errors if $userto…

…->emailto isn't supplied when sending messages
  • Loading branch information...
andyjdavis committed Nov 29, 2011
1 parent 779085b commit e5a3ba18f43f38d95078e8a8522c8d68c6ca95a3
Showing with 7 additions and 3 deletions.
  1. +3 −0 error/index.php
  2. +1 −1 lib/accesslib.php
  3. +2 −1 mod/forum/lib.php
  4. +1 −1 mod/quiz/locallib.php
View
@@ -19,6 +19,9 @@
$supportuser->email = $CFG->supportemail ? $CFG->supportemail : $admin->email;
$supportuser->firstname = $CFG->supportname ? $CFG->supportname : $admin->firstname;
$supportuser->lastname = $CFG->supportname ? '' : $admin->lastname;
+ //emailstop could be hard coded "false" to ensure error reports are sent
+ //but then admin's would have to alter their messaging preferences to temporarily stop them
+ $supportuser->emailstop = $admin->emailstop;
$supportuser->maildisplay = true;
/// Send the message and redirect
View
@@ -5205,7 +5205,7 @@ function get_role_users($roleid, $context, $parent = false, $fields = '',
if (empty($fields)) {
$fields = 'u.id, u.confirmed, u.username, u.firstname, u.lastname, '.
- 'u.maildisplay, u.mailformat, u.maildigest, u.email, u.city, '.
+ 'u.maildisplay, u.mailformat, u.maildigest, u.email, u.emailstop, u.city, '.
'u.country, u.picture, u.idnumber, u.department, u.institution, '.
'u.lang, u.timezone, u.lastaccess, u.mnethostid, r.name AS rolename, r.sortorder';
}
View
@@ -2839,6 +2839,7 @@ function forum_subscribed_users($course, $forum, $groupid=0, $context = null, $f
u.maildigest,
u.imagealt,
u.email,
+ u.emailstop,
u.city,
u.country,
u.lastaccess,
@@ -8357,4 +8358,4 @@ function forum_get_posts_by_user($user, array $courses, $musthaveaccess = false,
}
return $return;
-}
+}
View
@@ -1089,7 +1089,7 @@ function quiz_send_notification_emails($course, $quiz, $attempt, $context, $cm)
}
// check for notifications required
- $notifyfields = 'u.id, u.username, u.firstname, u.lastname, u.email, u.lang, u.timezone, u.mailformat, u.maildisplay';
+ $notifyfields = 'u.id, u.username, u.firstname, u.lastname, u.email, u.emailstop, u.lang, u.timezone, u.mailformat, u.maildisplay';
$groups = groups_get_all_groups($course->id, $USER->id);
if (is_array($groups) && count($groups) > 0) {
$groups = array_keys($groups);

0 comments on commit e5a3ba1

Please sign in to comment.