Using a Maria database (same SQL server as Moodle) to authenticate users from an external database. We don't want the user to be added to Moodle until they login, so we are NOT using cron to sync.
Moddle is authenticating the user, but the user is presented immediately with a blank profile form (user/edit.php). Isn't this form supposed to be pre-filled with data from the external database?
DEBUGGING that I've done:
In login/index.php, I added print_r($user) after 'if ($user)' and see values set for [username], [calendartype], and [language]. However most fields, such as [firstname], [lastname], [department], [country],... are empty.
In auth/db/auth.php, this code correctly returns the moodle field name and the mapped field name:foreach ($userfields as $field) {
if (!empty($this->config->{"field_map_$field"})) {
$moodleattributes[$field] = $this->config->{"field_map_$field"};
}
}