You are here

function hosting_get_client_from_user in Hosting 5

Same name and namespace in other branches
  1. 6.2 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()

Returns an associative array that provides the relationships a user has with different clients

4 calls to hosting_get_client_from_user()
hosting_client_user in client/hosting_client.access.inc
Implementation of hook_user().
hosting_node_grants in client/hosting_client.access.inc
Implementation of hook_node_grants().
hosting_site_form in site/hosting_site.module
Implementation of hook_form
hosting_site_validate in site/hosting_site.module

File

client/hosting_client.access.inc, line 226
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;
}