MDL-25708 recordsets - fix admin dir uses

This commit is contained in:
Eloy Lafuente (stronk7) 2010-12-30 00:41:47 +01:00
parent 8cdc85ac62
commit 755d2c74f6
6 changed files with 63 additions and 69 deletions

View file

@ -25,15 +25,14 @@ if (empty($CFG->messaging)) {
if ($confirm and !empty($msg) and confirm_sesskey()) {
list($in, $params) = $DB->get_in_or_equal($SESSION->bulk_users);
if ($rs = $DB->get_recordset_select('user', "id $in", $params)) {
foreach ($rs as $user) {
//TODO we should probably support all text formats here or only FORMAT_MOODLE
//For now bulk messaging is still using the html editor and its supplying html
//so we have to use html format for it to be displayed correctly
message_post_message($USER, $user, $msg, FORMAT_HTML, 'direct');
}
$rs->close();
$rs = $DB->get_recordset_select('user', "id $in", $params);
foreach ($rs as $user) {
//TODO we should probably support all text formats here or only FORMAT_MOODLE
//For now bulk messaging is still using the html editor and its supplying html
//so we have to use html format for it to be displayed correctly
message_post_message($USER, $user, $msg, FORMAT_HTML, 'direct');
}
$rs->close();
redirect($return);
}