function _bakery_save_destination_param in Bakery Single Sign-On System 7.3
Same name and namespace in other branches
- 8.2 bakery.module \_bakery_save_destination_param()
- 6.2 bakery.module \_bakery_save_destination_param()
- 7.4 bakery.module \_bakery_save_destination_param()
- 7.2 bakery.module \_bakery_save_destination_param()
Check if a form destination is set and save it in $data array.
Used to preserve destination in Bakery redirection to master and slave during login and registration.
Parameters
$form: Form definition to check.
$data: Array to store the detected destination value, if any.
See also
2 calls to _bakery_save_destination_param()
- _bakery_login_submit in ./
bakery.module - Handle login by redirecting to master.
- _bakery_register_submit in ./
bakery.module - Handle registration by redirecting to master.
File
- ./
bakery.module, line 319
Code
function _bakery_save_destination_param($form, &$data) {
// Hold on to destination if set.
if (strpos($form['#action'], 'destination=') !== FALSE) {
// If an absolute URL is in destination parse_url() will issue a warning
// and not populate $url_args so no further protection is needed.
parse_str(parse_url($form['#action'], PHP_URL_QUERY), $url_args);
if (!empty($url_args['destination'])) {
$data['destination'] = $url_args['destination'];
}
}
}