You are here

function hosting_ip_save in Hostmaster (Aegir) 6

IP Utility function for hook_update/hook_insert.

4 calls to hosting_ip_save()
hosting_server_insert in modules/hosting/server/hosting_server.module
Implementation of hook_insert().
hosting_server_update in modules/hosting/server/hosting_server.module
Implementation of hook_update().
hosting_site_insert in modules/hosting/site/hosting_site.nodeapi.inc
Implementation of hook_insert().
hosting_site_update in modules/hosting/site/hosting_site.nodeapi.inc
Implementation of hook_update().

File

modules/hosting/server/hosting.ip.inc, line 42
General IP address CRUD routines.

Code

function hosting_ip_save($node, $update = FALSE) {
  $ip_list = _hosting_ip_list($node->ip_addresses);
  if ($update) {
    hosting_ip_delete_revision($node);
  }
  foreach ($ip_list as $ip) {
    db_query("INSERT INTO {hosting_ip_addresses} (vid, nid, ip_address) VALUES (%d, %d, '%s')", $node->vid, $node->nid, $ip);
  }
}