You are here

function domain_configure_form_validate in Domain Access 6.2

Same name and namespace in other branches
  1. 7.2 domain.admin.inc \domain_configure_form_validate()

Validate the primary domain string.

File

./domain.admin.inc, line 349
Administration functions for the domain module.

Code

function domain_configure_form_validate($form, &$form_state) {
  if ($form_state['values']['op'] == $form_state['values']['reset']) {
    $subdomain = strtolower(rtrim($_SERVER['SERVER_NAME']));
  }
  else {
    $subdomain = $form_state['values']['domain_root'];
  }
  $domain_changed = (bool) strcmp($form_state['values']['domain_root'], $form['domain']['domain_root']['#default_value']);
  if ($domain_changed) {
    $error_list = domain_validate($subdomain);
    foreach ($error_list as $error) {
      form_set_error('domain_root', $error);
    }
  }
}