Permalink
Browse files

Auth fields were not being re-fetched on every login as expected. Fixed.

  • Loading branch information...
1 parent 530b833 commit 6eabcba1373052f0b99d21ba81b11ecebe65f90d martinlanghoff committed Jun 7, 2005
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/moodlelib.php
View
@@ -2252,9 +2252,13 @@ function update_user_record($username) {
if (function_exists('auth_get_userinfo')) {
$username = trim(moodle_strtolower($username)); /// just in case check text case
+ $oldinfo = get_record('user', 'username', $username, '','','','', 'username, auth');
+ $authconfig = get_config('auth/' . $oldinfo->auth);
+
if ($newinfo = auth_get_userinfo($username)) {
foreach ($newinfo as $key => $value){
- if (!empty($CFG->{'auth_user_' . $key. '_updatelocal'})) {
+ $confkey = 'field_updatelocal_' . $key;
+ if (!empty($authconfig->$confkey) && $authconfig->$confkey === 'onlogin') {
$value = addslashes(stripslashes($value)); // Just in case
set_field('user', $key, $value, 'username', $username);
}

0 comments on commit 6eabcba

Please sign in to comment.