MDL-17143

don't display the user description at all when user isn't enrolled in any courses, backported to 1.8
This commit is contained in:
dongsheng 2008-11-12 02:21:54 +00:00
parent 61f34d4260
commit 7e62718e7c
6 changed files with 32 additions and 1 deletions

View file

@ -201,7 +201,13 @@
// Print the description
if ($user->description && !isset($hiddenfields['description'])) {
echo format_text($user->description, FORMAT_MOODLE)."<hr />";
$has_courseid = ($course->id != SITEID);
if (!$has_courseid && !empty($CFG->profilesforenrolledusersonly)
&& !record_exists('role_assignments', 'userid', $id)) {
echo get_string('profilenotshown', 'moodle').'<hr />';
} else {
echo format_text($user->description, FORMAT_MOODLE)."<hr />";
}
}
// Print all the little details in a list