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.
This commit is contained in:
+3
-2
@@ -356,8 +356,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)) {
|
||||
|
||||
Reference in New Issue
Block a user