$extcourses = array();
while ($extcourse_obj = (object)$rs->FetchRow()) { // there are more course records
$extcourse_obj = (object)array_change_key_case((array)$extcourse_obj , CASE_LOWER);
- $extcourse = $extcourse_obj->{$CFG->enrol_remotecoursefield};
+ $extcourse = $extcourse_obj->{strtolower($CFG->enrol_remotecoursefield)};
array_push($extcourses, $extcourse);
// does the course exist in moodle already?
// slurp results into an array
while ($crs_obj = (object)$crs->FetchRow()) {
$crs_obj = (object)array_change_key_case((array)$crs_obj , CASE_LOWER);
- array_push($extenrolments, $crs_obj->{$CFG->enrol_remoteuserfield});
+ array_push($extenrolments, $crs_obj->{strtolower($CFG->enrol_remoteuserfield)});
}
$crs->close(); // release the handle