Skip to content
Permalink
Browse files

MDL-31520 user-ws: Optimised if statement for email access by moving …

…admin check to the start
  • Loading branch information...
Sam Hemelryk
Sam Hemelryk committed Jun 5, 2012
1 parent 4c3a1c6 commit d099f4fd0edc4df1bf1781e6478427813bcddcb8
Showing with 3 additions and 3 deletions.
  1. +3 −3 user/lib.php
@@ -309,11 +309,11 @@ function user_get_user_details($user, $course = null) {
}
}
if ($currentuser
if ($isadmin
of $currentuser

This comment has been minimized.

Copy link
@sunner

sunner Jun 12, 2012

Contributor

This should NOT be "of". It should be "or", isn't it? @samhemelryk

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))
or $isadmin) {
or ($user->maildisplay == 2 and enrol_sharing_course($user, $USER))) {
$userdetails['email'] = $user->email;;
}

0 comments on commit d099f4f

Please sign in to comment.
You can’t perform that action at this time.