You are here

function hosting_client_insert in Hosting 5

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

Implementation of hook_insert().

1 call to hosting_client_insert()
hosting_client_update in client/hosting_client.module
Implementation of hook_update().

File

client/hosting_client.module, line 224

Code

function hosting_client_insert($node) {
  db_query("INSERT INTO {hosting_client} (vid, nid, name, organization, email) VALUES (%d, %d, '%s', '%s', '%s' )", $node->vid, $node->nid, $node->client_name, $node->organization, $node->email);
  hosting_client_set_title($node);
  if (variable_get('hosting_client_register_user', FALSE) && !user_load(array(
    'mail' => $node->email,
  ))) {
    hosting_client_register_user($node);
  }
  if ($node->new_user) {
    $user = user_load(array(
      'name' => $node->new_user,
    ));
    db_query('INSERT INTO {hosting_client_user} (client, user, contact_type) VALUES (%d, %d, "%s")', $node->nid, $user->uid, '');
  }
}