MDL-23939 do not load groups and profile for guest user because they can not have both
This commit is contained in:
+12
-7
@@ -3802,18 +3802,23 @@ function get_complete_user_data($field, $value, $mnethostid = null) {
|
||||
|
||||
// this is a special hack to speedup calendar display
|
||||
$user->groupmember = array();
|
||||
if ($groups = $DB->get_records_sql($sql, array($user->id))) {
|
||||
foreach ($groups as $group) {
|
||||
if (!array_key_exists($group->courseid, $user->groupmember)) {
|
||||
$user->groupmember[$group->courseid] = array();
|
||||
if (!isguestuser($user)) {
|
||||
if ($groups = $DB->get_records_sql($sql, array($user->id))) {
|
||||
foreach ($groups as $group) {
|
||||
if (!array_key_exists($group->courseid, $user->groupmember)) {
|
||||
$user->groupmember[$group->courseid] = array();
|
||||
}
|
||||
$user->groupmember[$group->courseid][$group->id] = $group->id;
|
||||
}
|
||||
$user->groupmember[$group->courseid][$group->id] = $group->id;
|
||||
}
|
||||
}
|
||||
|
||||
/// Add the custom profile fields to the user record
|
||||
require_once($CFG->dirroot.'/user/profile/lib.php');
|
||||
profile_load_custom_fields($user);
|
||||
$user->profile = array();
|
||||
if (!isguestuser($user)) {
|
||||
require_once($CFG->dirroot.'/user/profile/lib.php');
|
||||
profile_load_custom_fields($user);
|
||||
}
|
||||
|
||||
/// Rewrite some variables if necessary
|
||||
if (!empty($user->description)) {
|
||||
|
||||
Reference in New Issue
Block a user