MDL-45941 messaging: submit all necessary user fields to message_send

This commit is contained in:
Marina Glancy 2014-06-18 16:37:27 +08:00
parent 33efee99ff
commit 0b47bbfa32

View File

@ -95,8 +95,9 @@ if ($data = data_submitted()) {
foreach ($data as $k => $v) {
if (preg_match('/^(user|teacher)(\d+)$/', $k, $m)) {
if (!array_key_exists($m[2], $SESSION->emailto[$id])) {
if ($user = $DB->get_record_select('user', "id = ?", array($m[2]), 'id,
' . $namefields . ', idnumber, email, mailformat, lastaccess, lang, maildisplay')) {
if ($user = $DB->get_record_select('user', "id = ?", array($m[2]), 'id, '.
$namefields . ', idnumber, email, mailformat, lastaccess, lang, '.
'maildisplay, auth, suspended, deleted, emailstop')) {
$SESSION->emailto[$id][$m[2]] = $user;
$count++;
}