function _bakery_login_submit in Bakery Single Sign-On System 6.2
Same name and namespace in other branches
- 8.2 bakery.module \_bakery_login_submit()
- 7.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 - Implementation of hook_form_alter().
File
- ./
bakery.module, line 460
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($_REQUEST['destination']);
// Save query parameters to be available when user returns from master.
$data['query'] = $_GET;
unset($data['query']['q']);
unset($data['query']['destination']);
// Create cookie and redirect to master.
bakery_bake_oatmeal_cookie($data['name'], $data);
drupal_goto(variable_get('bakery_master', 'http://drupal.org/') . 'bakery/login');
}