Merged from MOODLE_18_STABLE.
The fix is wrong, as it breaks auth_db_sync_users.php and
auth_ldap_sync_users.php at least. No new users are added to Moodle, as the
username is missing from the new user info record.
The fix needs to go into update_user_record() in lib/moodlelib.php to make it
skip the 'username' key, as we really need get_userinfo() to return the
username as part of the user info array.
}
}
}
+ $moodleattributes['username'] = $this->config->user_attribute;
return $moodleattributes;
}
/**
$moodleattributes[$field] = $this->config->{"field_map_$field"};
}
}
+ $moodleattributes['username'] = $this->config->fielduser;
return $moodleattributes;
}
}
}
}
+ $moodleattributes['username'] = $this->config->user_attribute;
return $moodleattributes;
}
$moodleattributes[$field] = $configarray["field_map_$field"];
}
}
+ $moodleattributes['username'] = $configarray["user_attribute"];
return $moodleattributes;
}
if ($newinfo = $userauth->get_userinfo($username)) {
$newinfo = truncate_userinfo($newinfo);
foreach ($newinfo as $key => $value){
+ if ($key === 'username') {
+ // 'username' is not a mapped updateable/lockable field, so skip it.
+ continue;
+ }
$confval = $userauth->config->{'field_updatelocal_' . $key};
$lockval = $userauth->config->{'field_lock_' . $key};
if (empty($confval) || empty($lockval)) {