mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-16043: manage case when administrator set enrol_remotecoursefield or enrol_remoteuserfield in UPPERCASE, merged from 19
This commit is contained in:
parent
55b4bb1d9e
commit
535f6e60e1
1 changed files with 2 additions and 2 deletions
|
@ -223,7 +223,7 @@ function sync_enrolments($role = null) {
|
||||||
$extcourses = array();
|
$extcourses = array();
|
||||||
while ($extcourse_obj = (object)$rs->FetchRow()) { // there are more course records
|
while ($extcourse_obj = (object)$rs->FetchRow()) { // there are more course records
|
||||||
$extcourse_obj = (object)array_change_key_case((array)$extcourse_obj , CASE_LOWER);
|
$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);
|
array_push($extcourses, $extcourse);
|
||||||
|
|
||||||
// does the course exist in moodle already?
|
// does the course exist in moodle already?
|
||||||
|
@ -279,7 +279,7 @@ function sync_enrolments($role = null) {
|
||||||
// slurp results into an array
|
// slurp results into an array
|
||||||
while ($crs_obj = (object)$crs->FetchRow()) {
|
while ($crs_obj = (object)$crs->FetchRow()) {
|
||||||
$crs_obj = (object)array_change_key_case((array)$crs_obj , CASE_LOWER);
|
$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
|
$crs->close(); // release the handle
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue