function autologout_get_current_path_as_destination in Automated Logout 7.4
Builds a destination query parameter for the current page.
This is identical to drupal_get_destination(), except that we always encode any existing destination query-string parameter, rather than honour it as an override.
This causes the user to be returned to the exact same URL they were on when they were auto-logged-off (with destination parameter untouched), rather than being directed straight to their destination.
1 call to autologout_get_current_path_as_destination()
- autologout_init in ./
autologout.module - Implements hook_init().
File
- ./
autologout.module, line 446 - Used to automagically log out a user after a preset time.
Code
function autologout_get_current_path_as_destination() {
$path = current_path();
$query = drupal_http_build_query(drupal_get_query_parameters());
if ($query != '') {
$path .= '?' . $query;
}
return array(
'destination' => $path,
);
}