Browse files

enrol/database: fix fields not read from external database MDL-7712

  • Loading branch information...
1 parent dd1ac4a commit 1d94add47e4a313340f3bf57e5f78d8610c49faa martinlanghoff committed Jan 15, 2007
Showing with 2 additions and 2 deletions.
  1. +2 −2 enrol/database/enrol.php
View
4 enrol/database/enrol.php
@@ -61,7 +61,7 @@ function setup_enrolments(&$user) {
error_log('[ENROL_DB] Using config default for roles: '.$role->shortname);
}*/
- if ($rs = $enroldb->Execute("SELECT {$CFG->enrol_remotecoursefield}
+ if ($rs = $enroldb->Execute("SELECT {$CFG->enrol_remotecoursefield} as enrolremotecoursefield
FROM {$CFG->enrol_dbtable}
WHERE {$CFG->enrol_remoteuserfield} = " . $useridfield .
(isset($remote_role_name, $remote_role_value) ? ' AND '.$remote_role_name.' = '.$remote_role_value : ''))) {
@@ -84,7 +84,7 @@ function setup_enrolments(&$user) {
$courselist = array();
while (!$rs->EOF) { // Make a nice little array of courses to process
- $courselist[] = $rs->fields[0];
+ $courselist[] = $rs->fields['enrolremotecoursefield'];
$rs->MoveNext();
}
$rs->Close();

0 comments on commit 1d94add

Please sign in to comment.