}
}
+/// Add the custom profile fields to the user record
+ include_once($CFG->dirroot.'/user/profile/lib.php');
+ $customfields = (array)profile_user_record($user->id);
+ foreach ($customfields as $cname=>$cvalue) {
+ if (!isset($user->$cname)) { // Don't overwrite any standard fields
+ $user->$cname = $cvalue;
+ }
+ }
+
/// Rewrite some variables if necessary
if (!empty($user->description)) {
$user->description = true; // No need to cart all of it around