Skip to content

Commit

Permalink
MDL-35644 user_get_details: admin should be able to see description
Browse files Browse the repository at this point in the history
  • Loading branch information
mouneyrac committed Sep 26, 2012
1 parent c366bea commit 3f676aa
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions user/lib.php
Expand Up @@ -324,15 +324,13 @@ function user_get_user_details($user, $course = null, array $userfields = array(
$userdetails['phone2'] = $user->phone2; $userdetails['phone2'] = $user->phone2;
} }


if (isset($user->description) && (!isset($hiddenfields['description']) or $isadmin)) { if (isset($user->description) &&
if (!$cannotviewdescription) { ((!isset($hiddenfields['description']) && !$cannotviewdescription) or $isadmin)) {

if (in_array('description', $userfields)) {
if (in_array('description', $userfields)) { // Always return the descriptionformat if description is requested.
// Always return the descriptionformat if description is requested. list($userdetails['description'], $userdetails['descriptionformat']) =
list($userdetails['description'], $userdetails['descriptionformat']) = external_format_text($user->description, $user->descriptionformat,
external_format_text($user->description, $user->descriptionformat, $usercontext->id, 'user', 'profile', null);
$usercontext->id, 'user', 'profile', null);
}
} }
} }


Expand Down

0 comments on commit 3f676aa

Please sign in to comment.