You are here

function _login_destination_get_current in Login Destination 7

Get the current path (before trigger was invoked).

Parameters

string $trigger: Trigger.

Return value

string

3 calls to _login_destination_get_current()
login_destination_get_destination in ./login_destination.module
Process all destination rules and return destination path.
login_destination_user_logout in ./login_destination.module
Implements hook_user_logout().
_login_destination_evaluate_rule in ./login_destination.module
A helper function to evaluate destination path.

File

./login_destination.module, line 459
Control where users are directed to, once they login

Code

function _login_destination_get_current($trigger = '') {
  if (isset($_GET['current'])) {
    return check_plain($_GET['current']);
  }
  $menu_item = menu_get_item();
  if ($trigger == 'login' && $menu_item['path'] != 'user/reset/%/%/%') {
    return $_GET['q'];
  }

  // Front by default.
  return '';
}