You are here

function hosting_ip_validate in Hostmaster (Aegir) 6

Validate that IP list is valid. IP utility function for hook_validate.

1 call to hosting_ip_validate()
hosting_server_validate in modules/hosting/server/hosting_server.module
Implementation of hook_validate().

File

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

Code

function hosting_ip_validate($node) {
  foreach (_hosting_ip_list($node->ip_addresses) as $ip) {
    if (!_hosting_valid_ip($ip)) {
      form_set_error('ip_addresses', t('Invalid IP address: %ip.', array(
        '%ip' => $ip,
      )));
    }
  }
}