From b78fbdac9df4db1504731e534256a7148f3b5e62 Mon Sep 17 00:00:00 2001 From: thepurpleblob Date: Thu, 9 Jun 2005 14:04:38 +0000 Subject: [PATCH] changes merged from STABLE --- backup/restore_check.html | 5 +++-- lib/moodlelib.php | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/backup/restore_check.html b/backup/restore_check.html index 8ed35d7eb64..6595c9b5e2f 100644 --- a/backup/restore_check.html +++ b/backup/restore_check.html @@ -21,8 +21,9 @@ } // check for session objects - assert_var_set( $info, 'info' ); - assert_var_set( $course_header, 'course_header' ); + if (empty($info)) or empty($course_info)) { + error( 'important information missing from SESSION' ); + } //If the restore object doesn't exist, we are going //to check every variable individually and create it diff --git a/lib/moodlelib.php b/lib/moodlelib.php index ee3d422588c..2c691eb18ed 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -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); }