Permalink
Browse files

Allow admin to consult user email address

Currently the admin user cannot check the user email using this function. This fix allows the admin user to retrieve the email in any situation.
  • Loading branch information...
1 parent 4f7f2a8 commit 90e30b965f023a0e784e089c7f9df682f0c7d865 @fabiomsouto fabiomsouto committed Feb 8, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 user/lib.php
View
@@ -380,8 +380,9 @@ function user_get_user_details($user, $course = null, array $userfields = array(
if (in_array('email', $userfields) && ($currentuser
or $canviewuseremail // this is a capability in course context, it will be false in usercontext
or $user->maildisplay == 1
- or ($user->maildisplay == 2 and enrol_sharing_course($user, $USER)))) {
- $userdetails['email'] = $user->email;;
+ or ($user->maildisplay == 2 and enrol_sharing_course($user, $USER))
+ or $isadmin)) {
+ $userdetails['email'] = $user->email;
}
if (in_array('interests', $userfields) && !empty($CFG->usetags)) {

0 comments on commit 90e30b9

Please sign in to comment.