You are here

function hosting_client_users in Hosting 7.3

Same name and namespace in other branches
  1. 6.2 client/hosting_client.module \hosting_client_users()
  2. 7.4 client/hosting_client.module \hosting_client_users()

Return a list of users for a given client.

Parameters

int|object $node: Client node (as nid or node object).

Return value

array Array of user names indexed by uid.

2 calls to hosting_client_users()
hosting_client_form in client/hosting_client.module
Implements hook_form().
hosting_client_view in client/hosting_client.module
Implements hook_view().

File

client/hosting_client.module, line 621

Code

function hosting_client_users($node) {
  if (is_object($node)) {
    $node = $node->nid;
  }
  elseif (!is_numeric($node)) {
    return array();
  }

  // @todo: Figure out why variable substitution doesn't work here.
  return db_query("SELECT u.uid, u.name, h.client FROM {hosting_client_user} h INNER JOIN {users} u ON u.uid = h.user WHERE h.client = {$node}")
    ->fetchAllKeyed();
}