You are here

function domain_create_form_submit in Domain Access 5

FormsAPI for domain_create_form()

File

./domain_admin.inc, line 488
Administration functions for the domain module.

Code

function domain_create_form_submit($form_id, $form_values) {
  db_query("INSERT INTO {domain} (subdomain, sitename, scheme, valid) VALUES ('%s', '%s', '%s', %d)", $form_values['subdomain'], $form_values['sitename'], $form_values['scheme'], $form_values['valid']);

  // Let other modules act.
  $domain = domain_lookup(NULL, $form_values['subdomain']);
  module_invoke_all('domainupdate', 'create', $domain, $form_values);

  // The user_submitted flag is needed for Domain User.
  if (!$form_values['domain_arguments']['user_submitted']) {
    drupal_set_message(t('Domain record created.'));
    drupal_goto('admin/build/domain/view');
  }
}