You are here

function hosting_site_update in Hostmaster (Aegir) 6

Implementation of hook_update().

File

modules/hosting/site/hosting_site.nodeapi.inc, line 168
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;
    }
    hosting_ip_save($node, TRUE);
    db_query("UPDATE {hosting_site} SET client = %d, db_server = %d, 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->platform, $node->last_cron, $node->cron_key, $node->site_status, $node->profile, $node->site_language, $node->verified, $node->vid);
  }
  if (!$node->no_verify) {
    hosting_add_task($node->nid, 'verify');
  }
}