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

Thanks to Alan Barrett for the fix. Merged from MOODLE_19_STABLE
This commit is contained in:
ikawhero 2008-12-24 04:17:56 +00:00
parent b364b9ce03
commit 76727901a6

View File

@ -242,7 +242,11 @@ class profile_field_base {
case PROFILE_VISIBLE_ALL: case PROFILE_VISIBLE_ALL:
return true; return true;
case PROFILE_VISIBLE_PRIVATE: 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: default:
return has_capability('moodle/user:update', get_context_instance(CONTEXT_SYSTEM)); return has_capability('moodle/user:update', get_context_instance(CONTEXT_SYSTEM));
} }