function _bakery_register_submit in Bakery Single Sign-On System 7.2
Same name and namespace in other branches
- 8.2 bakery.module \_bakery_register_submit()
- 6.2 bakery.module \_bakery_register_submit()
- 7.3 bakery.module \_bakery_register_submit()
Handle registration by redirecting to master.
1 string reference to '_bakery_register_submit'
- bakery_form_alter in ./
bakery.module - Implements hook_form_alter().
File
- ./
bakery.module, line 485 - Module file for the Bakery.
Code
function _bakery_register_submit($form, &$form_state) {
// Create an array of fields to send to the master. We need these four fields.
$allowed = array(
'name',
'mail',
'pass',
'timezone',
);
foreach ($form_state['values'] as $key => $value) {
if (!in_array($key, $allowed)) {
unset($form_state['values'][$key]);
}
}
// Remove unneeded values.
form_state_values_clean($form_state);
// Save values to cookie.
$data = $form_state['values'];
_bakery_save_destination_param($form, $data);
unset($_GET['destination']);
// Store name and email in case of error and return from master.
$_SESSION['bakery']['register'] = array(
'name' => $data['name'],
'mail' => $data['mail'],
);
// Create cookie and redirect to master.
bakery_bake_oatmeal_cookie($data['name'], $data);
drupal_goto(variable_get('bakery_master', 'http://drupal.org/') . 'bakery');
}