Browse files

MDL-17228 Allow admins to view hidden custom profile fields.

Thanks to Alan Barrett for the fix.
  • Loading branch information...
1 parent edd41a9 commit 351c28559b71259de43d3256e1a44f85e613c2ec ikawhero committed Dec 24, 2008
Showing with 5 additions and 1 deletion.
  1. +5 −1 user/profile/lib.php
View
6 user/profile/lib.php
@@ -236,7 +236,11 @@ function is_visible() {
case PROFILE_VISIBLE_ALL:
return true;
case PROFILE_VISIBLE_PRIVATE:
- return ($this->userid == $USER->id);
+ if ($this->userid == $USER->id) {
+ return true;
+ } else {
+ return has_capability('moodle/user:update', get_context_instance(CONTEXT_SYSTEM));
+ }
default:
return has_capability('moodle/user:update', get_context_instance(CONTEXT_SYSTEM));
}

0 comments on commit 351c285

Please sign in to comment.