Permalink
Browse files

Merge branch 'MDL-24724_course_profile' of git://github.com/andyjdavi…

…s/moodle
  • Loading branch information...
2 parents e7104d2 + 8d22e34 commit 65361ab836b0fa62e9b3e9b5f62f2559157cce3a @skodak skodak committed Mar 14, 2011
Showing with 9 additions and 0 deletions.
  1. +9 −0 user/view.php
View
@@ -236,6 +236,15 @@
echo '<table class="list" summary="">';
+//checks were performed above that ensure that if we've got to here either the user
+//is viewing their own profile ($USER->id == $user->id) or $user is enrolled in the course
+if ($currentuser
+ or $user->maildisplay == 1 //allow everyone to see email address
+ or ($user->maildisplay == 2 && is_enrolled($coursecontext, $USER)) //fellow course members can see email. Already know $user is enrolled
+ or has_capability('moodle/course:useremail', $coursecontext)) {
+ print_row(get_string("email").":", obfuscate_mailto($user->email, ''));
+}
+
// Show last time this user accessed this course
if (!isset($hiddenfields['lastaccess'])) {
if ($lastaccess = $DB->get_record('user_lastaccess', array('userid'=>$user->id, 'courseid'=>$course->id))) {

0 comments on commit 65361ab

Please sign in to comment.