You are here

function hosting_site_update in Hosting 6.2

Same name and namespace in other branches
  1. 5 site/hosting_site.module \hosting_site_update()
  2. 7.4 site/hosting_site.nodeapi.inc \hosting_site_update()
  3. 7.3 site/hosting_site.nodeapi.inc \hosting_site_update()

Implementation of hook_update().

File

site/hosting_site.nodeapi.inc, line 170
Site nodeapi implementations.

Code

function hosting_site_update(&$node) {

  // if this is a new node or we're adding a new revision,
  if (!empty($node->revision)) {
    hosting_site_insert($node);
  }
  else {
    $client = hosting_get_client($node->client);
    $node->client = $client->nid;
    if ($node->site_status == HOSTING_SITE_DELETED) {
      $node->no_verify = TRUE;
    }
    db_query("UPDATE {hosting_site} SET client = %d, db_server = %d, db_name = '%s', platform = %d, last_cron = %d, cron_key = '%s', status = %d, profile = %d, language = '%s', verified = %d WHERE vid=%d", $node->client, $node->db_server, $node->db_name, $node->platform, $node->last_cron, $node->cron_key, $node->site_status, $node->profile, $node->site_language, $node->verified, $node->vid);
  }
  if ((isset($node->no_verify) && $node->no_verify) == FALSE) {
    hosting_add_task($node->nid, 'verify');
  }
}