Permalink
Browse files

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

Conflicts:

	user/lib.php
  • Loading branch information...
1 parent f9a8571 commit 55cab152a47c72331162d64db229e306aa6b4121 @mouneyrac mouneyrac committed Sep 26, 2012
Showing with 8 additions and 9 deletions.
  1. +8 −9 user/lib.php
View
17 user/lib.php
@@ -296,16 +296,15 @@ 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 (isset($user->description) &&
+ ((!isset($hiddenfields['description']) && !$cannotviewdescription) or $isadmin)) {
- if (in_array('description', $userfields)) {
- $user->description = file_rewrite_pluginfile_urls($user->description, 'pluginfile.php', $usercontext->id, 'user', 'profile', null);
- $userdetails['description'] = $user->description;
- }
- if (in_array('descriptionformat', $userfields)) {
- $userdetails['descriptionformat'] = $user->descriptionformat;
- }
+ if (in_array('description', $userfields)) {
+ $user->description = file_rewrite_pluginfile_urls($user->description, 'pluginfile.php', $usercontext->id, 'user', 'profile', null);
+ $userdetails['description'] = $user->description;
+ }
+ if (in_array('descriptionformat', $userfields)) {
+ $userdetails['descriptionformat'] = $user->descriptionformat;
}
}

0 comments on commit 55cab15

Please sign in to comment.