You are here

function _support_validate_domains in Support Ticketing System 7

Same name and namespace in other branches
  1. 6 support.admin.inc \_support_validate_domains()

Validate domains by doing a dns lookup on each.

2 calls to _support_validate_domains()
support_admin_settings_validate in ./support.admin.inc
Be sure valid domains are entered.
support_client_form_validate in ./support.admin.inc

File

./support.admin.inc, line 613
support.admin.inc

Code

function _support_validate_domains($field, $domains = array()) {
  foreach ($domains as $domain) {
    $domain = trim($domain);
    if ($domain && ($domain != '*' && function_exists('checkdnsrr') && !checkdnsrr($domain))) {
      form_set_error($field, t('Invalid domain: %domain', array(
        '%domain' => $domain,
      )));
    }
  }
}