You are here

function hosting_signup_form_submit in Hostmaster (Aegir) 6

Form submission

Generates the nodes and saves them.

File

modules/hosting/signup/hosting_signup.module, line 111
Provides a signup form that can be run on remote sites

Code

function hosting_signup_form_submit($form, &$form_state) {
  $client = (object) $form_state['values'];
  $client->type = 'client';
  $client->status = 1;
  $client->title = $client->client_name;
  node_save($client, 'submit');
  $site = (object) $form_state['values'];
  $site->type = 'site';
  $site->status = 1;
  $site->client = $client->nid;
  $site->uid = $client->uid;
  node_save($site);
  $form_state['redirect'] = sprintf("hosting/signup/thanks/%s/%s/%s", $site->title, $client->email, $client->client_name);
}