mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 04:33:13 +01:00
Include custom profile fields when setting up a user object
This commit is contained in:
parent
66643c0aa8
commit
323ccc26b6
@ -3157,6 +3157,15 @@ function get_complete_user_data($field, $value, $mnethostid=null) {
|
||||
}
|
||||
}
|
||||
|
||||
/// Add the custom profile fields to the user record
|
||||
include_once($CFG->dirroot.'/user/profile/lib.php');
|
||||
$customfields = (array)profile_user_record($user->id);
|
||||
foreach ($customfields as $cname=>$cvalue) {
|
||||
if (!isset($user->$cname)) { // Don't overwrite any standard fields
|
||||
$user->$cname = $cvalue;
|
||||
}
|
||||
}
|
||||
|
||||
/// Rewrite some variables if necessary
|
||||
if (!empty($user->description)) {
|
||||
$user->description = true; // No need to cart all of it around
|
||||
|
Loading…
x
Reference in New Issue
Block a user