You are here

function hosting_get_client_from_user in Hosting 6.2

Same name and namespace in other branches
  1. 5 client/hosting_client.access.inc \hosting_get_client_from_user()
  2. 7.4 client/hosting_client.access.inc \hosting_get_client_from_user()
  3. 7.3 client/hosting_client.access.inc \hosting_get_client_from_user()

Get relationships a user has with different clients.

Parameters

$uid: The user to get the relationships for.

Return value

An array of clients and their contact type relationships to the specified user.

5 calls to hosting_get_client_from_user()
hosting_client_node_grants in client/hosting_client.access.inc
Implements hook_node_grants().
hosting_client_user in client/hosting_client.access.inc
Implements hook_user().
hosting_quota_nodeapi in quota/hosting_quota.module
Implements hook_nodeapi().
hosting_site_validate in site/hosting_site.form.inc
Implements hook_validate().
_hosting_client_site_default in client/hosting_client.module
Get the default value of the client field for a site node.

File

client/hosting_client.access.inc, line 263
Control client node access.

Code

function hosting_get_client_from_user($uid) {
  $clients = array();
  if ($results = db_query("SELECT client, contact_type FROM {hosting_client_user} WHERE user=%d", $uid)) {
    while ($result = db_fetch_array($results)) {
      $clients[$result['client']] = explode(',', $result['contact_type']);
    }
  }
  return $clients;
}