=================================================================== RCS file: /cvsroot/moodle/moodle/auth/mnet/auth.php,v retrieving revision 1.27.2.20 diff -r1.27.2.20 auth.php 122a123,141 > > // PATCH : get user's custom fields and aggregate them to the user profile > $sql = " > SELECT > f.shortname, > d.data > FROM > {$CFG->prefix}user_info_field f, > {$CFG->prefix}user_info_data d > WHERE > d.userid = {$mnet_session->userid} AND > f.id = d.fieldid > "; > if ($profilefields = get_records_sql_menu($sql)){ > foreach($profilefields as $fieldname => $fielddata){ > $userdata["profile_field_{$fieldname}"] = $fielddata; > } > } > // /PATCH 376a385,401 > // PATCH : capture profile fields, check if corresponding entry is defined and update data > if (preg_match('/^profile_field_(.*)/', $key, $matches)){ > $fieldname = $matches[1]; > if ($field = get_record('user_info_field', 'shortname', $fieldname)){ > $datum->fieldid = $field->id; > $datum->userid = $localuser->id; > $datum->data = $val; > if ($oldrecord = get_record('user_info_data', 'fieldid', $field->id, 'userid', $localuser->id)){ > $datum->id = $oldrecord->id; > update_record('user_info_data', $datum); > } else { > insert_record('user_info_data', $datum); > } > } > } > > // /PATCH