From 351c28559b71259de43d3256e1a44f85e613c2ec Mon Sep 17 00:00:00 2001 From: ikawhero Date: Wed, 24 Dec 2008 04:16:21 +0000 Subject: [PATCH] MDL-17228 Allow admins to view hidden custom profile fields. Thanks to Alan Barrett for the fix. --- user/profile/lib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/user/profile/lib.php b/user/profile/lib.php index e9eab61bf00..8a0820e261b 100644 --- a/user/profile/lib.php +++ b/user/profile/lib.php @@ -236,7 +236,11 @@ class profile_field_base { 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)); }