From 535f6e60e1ce3356a37ba455a7211b3b5966c80c Mon Sep 17 00:00:00 2001 From: jerome Date: Wed, 27 Aug 2008 07:27:13 +0000 Subject: [PATCH] MDL-16043: manage case when administrator set enrol_remotecoursefield or enrol_remoteuserfield in UPPERCASE, merged from 19 --- enrol/database/enrol.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/enrol/database/enrol.php b/enrol/database/enrol.php index 78c0bfb29ae..8af7b996979 100644 --- a/enrol/database/enrol.php +++ b/enrol/database/enrol.php @@ -223,7 +223,7 @@ function sync_enrolments($role = null) { $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? @@ -279,7 +279,7 @@ function sync_enrolments($role = null) { // 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