function _acquia_agent_provision_freetrial in Acquia Connector 6
Same name and namespace in other branches
- 7 acquia_agent/acquia_agent.pages.inc \_acquia_agent_provision_freetrial()
1 call to _acquia_agent_provision_freetrial()
- _acquia_agent_an_trial_details_form_validate in acquia_agent/
acquia_agent.pages.inc
File
- acquia_agent/
acquia_agent.pages.inc, line 117 - Acquia Agent configuration page.
Code
function _acquia_agent_provision_freetrial($form, &$form_state) {
$val = $form_state['values'] + $form_state['storage']['values'];
$body = array();
$body['accept_terms_checkbox'] = 1;
$new_user = empty($form_state['storage']['userdata']['uid']);
if ($new_user) {
// New user
$body['primary_email'] = $val['email'];
$pass = $val['pass'];
// Send password as hash.
$body['pass'] = md5($val['pass']);
$body['billing_first_name'] = $val['billing_first_name'];
$body['billing_last_name'] = $val['billing_last_name'];
}
else {
// Existing user
$body['uid'] = $form_state['storage']['userdata']['uid'];
$pass = $val['pass'];
}
$body['subscription_name'] = $val['subscription_name'];
$body['site_url'] = $val['site_url'];
$body['billing_company'] = $val['billing_company'];
$body['billing_phone'] = $val['billing_phone'];
$body['billing_country_acquia'] = $val['billing_country_acquia'];
$auth = _acquia_agent_create_authenticator($body, $new_user ? NULL : $pass);
return _acquia_agent_call_provision_freetrial($body, $auth, $pass);
}