You are here

function hosting_client_users in Hosting 6.2

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

Return a list of users for a given client.

Parameters

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

Return value

Array of user names indexed by uid.

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

File

client/hosting_client.module, line 478

Code

function hosting_client_users($node) {
  if (is_object($node)) {
    $node = $node->nid;
  }
  elseif (!is_numeric($node)) {
    return array();
  }
  $users = array();
  $q = db_query("SELECT u.uid, u.name FROM {hosting_client_user} h INNER JOIN {users} u ON u.uid = h.user WHERE h.client = %d", $node);
  while ($result = db_fetch_array($q)) {
    $users[$result['uid']] = $result['name'];
  }
  return $users;
}