function _bakery_login_submit in Bakery Single Sign-On System 7.2
Same name and namespace in other branches
- 8.2 bakery.module \_bakery_login_submit()
- 6.2 bakery.module \_bakery_login_submit()
- 7.3 bakery.module \_bakery_login_submit()
Handle login by redirecting to master.
1 string reference to '_bakery_login_submit'
- bakery_form_alter in ./
bakery.module - Implements hook_form_alter().
File
- ./
bakery.module, line 514 - Module file for the Bakery.
Code
function _bakery_login_submit($form, &$form_state) {
// Get rid of all the values we don't explicitly know we want. While this may
// break some modules it ensures we don't send sensitive data between sites.
$allowed = array(
'name',
'pass',
'op',
);
foreach ($form_state['values'] as $key => $value) {
if (!in_array($key, $allowed)) {
unset($form_state['values'][$key]);
}
}
$data = $form_state['values'];
_bakery_save_destination_param($form, $data);
unset($_GET['destination']);
// Save query parameters to be available when user returns from master.
$data['query'] = drupal_get_query_parameters();
// Create cookie and redirect to master.
bakery_bake_oatmeal_cookie($data['name'], $data);
drupal_goto(variable_get('bakery_master', 'http://drupal.org/') . 'bakery/login');
}