You are here

function hosting_get_client in Hosting 5

Same name and namespace in other branches
  1. 6.2 client/hosting_client.module \hosting_get_client()
  2. 7.4 client/hosting_client.module \hosting_get_client()
  3. 7.3 client/hosting_client.module \hosting_get_client()
5 calls to hosting_get_client()
hosting_client_user_form_submit in client/hosting_client.access.inc
hosting_client_user_form_validate in client/hosting_client.access.inc
hosting_site_insert in site/hosting_site.module
hosting_site_update in site/hosting_site.module
hosting_site_validate in site/hosting_site.module

File

client/hosting_client.module, line 73

Code

function hosting_get_client($client) {
  if (is_numeric($client)) {
    $result = db_result(db_query("SELECT n.nid FROM {hosting_client} h INNER JOIN {node} n ON n.nid = h.nid WHERE n.nid = %d", $client));
  }
  else {
    $result = db_result(db_query("SELECT c.nid FROM {hosting_client} c JOIN {node} n ON c.nid = n.nid WHERE (n.title = '%s' OR c.email = '%s') AND n.type = 'client'", $client, $client));
  }
  if ($result) {
    return node_load($result);
  }
  return false;
}