Skip to content
Browse files

MDL-35644 user_get_details: admin should be able to see description

  • Loading branch information...
1 parent c366bea commit 3f676aa5bdbd3b6e5edbb09dfe66c8217b232169 @mouneyrac mouneyrac committed Sep 26, 2012
Showing with 7 additions and 9 deletions.
  1. +7 −9 user/lib.php
View
16 user/lib.php
@@ -324,15 +324,13 @@ function user_get_user_details($user, $course = null, array $userfields = array(
$userdetails['phone2'] = $user->phone2;
}
- if (isset($user->description) && (!isset($hiddenfields['description']) or $isadmin)) {
- if (!$cannotviewdescription) {
-
- if (in_array('description', $userfields)) {
- // Always return the descriptionformat if description is requested.
- list($userdetails['description'], $userdetails['descriptionformat']) =
- external_format_text($user->description, $user->descriptionformat,
- $usercontext->id, 'user', 'profile', null);
- }
+ if (isset($user->description) &&
+ ((!isset($hiddenfields['description']) && !$cannotviewdescription) or $isadmin)) {
+ if (in_array('description', $userfields)) {
+ // Always return the descriptionformat if description is requested.
+ list($userdetails['description'], $userdetails['descriptionformat']) =
+ external_format_text($user->description, $user->descriptionformat,
+ $usercontext->id, 'user', 'profile', null);
}
}

0 comments on commit 3f676aa

Please sign in to comment.
Something went wrong with that request. Please try again.