You are here

function _user_resource_retrieve in Services 7.3

Same name and namespace in other branches
  1. 6.3 resources/user_resource.inc \_user_resource_retrieve()

Get user details.

Parameters

$uid: UID of the user to be loaded.

Return value

A user object.

See also

user_load()

1 string reference to '_user_resource_retrieve'
_user_resource_definition in resources/user_resource.inc

File

resources/user_resource.inc, line 289

Code

function _user_resource_retrieve($uid) {
  $account = user_load($uid);
  if (empty($account)) {
    return services_error(t('There is no user with ID @uid.', array(
      '@uid' => $uid,
    )), 404);
  }
  services_remove_user_data($account);

  //Lets check field_permissions
  $account = services_field_permissions_clean('view', 'user', $account);

  // Everything went right.
  return $account;
}