You are here

function bakery_get_destination in Bakery Single Sign-On System 7.2

Get the bakery destination from the bd query parameter, if set.

1 call to bakery_get_destination()
_bakery_login_redirect in ./bakery.module
Redirect back to a subsite after login.

File

./bakery.module, line 423
Module file for the Bakery.

Code

function bakery_get_destination() {
  $parameters = drupal_get_query_parameters();
  if (isset($parameters['bd']) && is_string($parameters['bd']) && $parameters['bd'] === drupal_strip_dangerous_protocols($parameters['bd'])) {
    foreach (variable_get('bakery_slaves', array()) as $subsite) {
      if (strpos($parameters['bd'], $subsite) === 0) {
        $url = drupal_parse_url(urldecode($parameters['bd']));
        return [
          $url['path'],
          [
            'query' => $url['query'],
          ],
        ];
      }
    }
  }
  return FALSE;
}