Merge branch 'MDL-40424-master' of git://github.com/FMCorz/moodle

Conflicts:
	admin/oacleanup.php
This commit is contained in:
Eloy Lafuente (stronk7) 2013-07-17 01:21:51 +02:00
commit fb1788c598
18 changed files with 105 additions and 46 deletions

View file

@ -39,9 +39,10 @@ while(!feof($fd)) {
$action = clam_handle_infected_file($file,$log->userid,true);
clam_replace_infected_file($file);
list($ctxselect, $ctxjoin) = context_instance_preload_sql('c.id', CONTEXT_COURSE, 'ctx');
$ctxselect = ', ' . context_helper::get_preload_record_columns_sql('ctx');
$ctxjoin = "LEFT JOIN {context} ctx ON (ctx.instanceid = c.id AND ctx.contextlevel = :contextlevel)";
$sql = "SELECT c.id, c.fullname $ctxselect FROM {course} c $ctxjoin WHERE c.id = :courseid";
$course = $DB->get_record_sql($sql, array('courseid' => $log->course));
$course = $DB->get_record_sql($sql, array('courseid' => $log->course, 'contextlevel' => CONTEXT_COURSE));
context_helper::preload_from_record($course);
$user = $DB->get_record("user", array("id"=>$log->userid));