Index: user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user.module,v retrieving revision 1.424 diff -u -r1.424 user.module --- user.module 15 Dec 2004 21:19:42 -0000 1.424 +++ user.module 20 Dec 2004 01:31:39 -0000 @@ -1176,19 +1176,23 @@ function user_view($uid = 0) { global $user; - if ($account = user_load(array('uid' => $uid, 'status' => 1))) { - // Retrieve and merge all profile fields: - $fields = array(); - foreach (module_list() as $module) { - if ($data = module_invoke($module, 'user', 'view', '', $account)) { - foreach ($data as $category => $content) { - $fields[$category] .= $content; + if ($account = user_load(array('uid' => $uid))) { + if ($account->status == 1 || user_access('administer users')) { + // Retrieve and merge all profile fields: + $fields = array(); + foreach (module_list() as $module) { + if ($data = module_invoke($module, 'user', 'view', '', $account)) { + foreach ($data as $category => $content) { + $fields[$category] .= $content; + } } } + drupal_set_title($account->name); + print theme('page', theme('user_profile', $account, $fields)); + } + else { + drupal_access_denied(); } - - drupal_set_title($account->name); - print theme('page', theme('user_profile', $account, $fields)); } else { drupal_not_found(); ***** CVS exited normally with code 1 *****