MDL-22884 fixed sloppy userid related bugs in enrol code - big thanks to Andrew for spotting this and making patch

This commit is contained in:
Petr Skoda
2010-06-22 06:26:39 +00:00
parent bd251bf9b7
commit 87163782d5
+2 -2
View File
@@ -493,7 +493,7 @@ function enrol_get_users_courses($userid, $onlyactive = false, $fields = NULL, $
global $DB;
// Guest account does not have any courses
if (isguestuser($userid) or !empty($userid)) {
if (isguestuser($userid) or empty($userid)) {
return(array());
}
@@ -558,7 +558,7 @@ function enrol_get_users_courses($userid, $onlyactive = false, $fields = NULL, $
$ccjoin
$wheres
$orderby";
$params['userid'] = $USER->id;
$params['userid'] = $userid;
$courses = $DB->get_records_sql($sql, $params);