Merge branch 'MDL_56093' of https://github.com/eledia/moodle
authorAndrew Nicols <andrew@nicols.co.uk>
Mon, 9 Jul 2018 04:13:58 +0000 (12:13 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Mon, 9 Jul 2018 04:13:58 +0000 (12:13 +0800)
auth/db/auth.php

index bcb26df..14ca12f 100644 (file)
@@ -473,6 +473,12 @@ class auth_plugin_db extends auth_plugin_base {
                     set_user_preference('auth_forcepasswordchange', 1, $id);
                     set_user_preference('create_password',          1, $id);
                 }
+
+                // Save custom profile fields here(MDL-56093).
+                require_once($CFG->dirroot . '/user/profile/lib.php');
+                $user->id = $id;
+                profile_save_data($user);
+
                 // Make sure user context is present.
                 context_user::instance($id);
             }