You are here

function _r4032login_destination in Redirect 403 to User Login 6

Version of drupal_get_destination which works inside of a 403 callback

1 call to _r4032login_destination()
r4032login_redirect in ./r4032login.module
MENU_CALLBACK for /4032login

File

./r4032login.module, line 156
Redirect denied pages to the user login form.

Code

function _r4032login_destination() {

  // When on an access denied page, Drupal stores the original path in
  // $_REQUEST['destination'] in drupal_access_denied().
  $path = isset($_REQUEST['destination']) ? $_REQUEST['destination'] : '';
  $query = drupal_query_string_encode($_GET, array(
    'q',
  ));
  if ($query != '') {
    $path .= '?' . $query;
  }
  return 'destination=' . urlencode($path);
}