You are here

function _bakery_save_destination_param in Bakery Single Sign-On System 7.4

Same name and namespace in other branches
  1. 8.2 bakery.module \_bakery_save_destination_param()
  2. 6.2 bakery.module \_bakery_save_destination_param()
  3. 7.2 bakery.module \_bakery_save_destination_param()
  4. 7.3 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

drupal_goto()

File

./bakery.module, line 253

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'];
    }
  }
}