You are here

function _ulogin_token_url in uLogin (advanced version) 7

Same name and namespace in other branches
  1. 6 ulogin.module \_ulogin_token_url()
1 call to _ulogin_token_url()
ulogin_widget_pre_render in ./ulogin.module
Pre-render callback for the 'ulogin_widget' element.

File

./ulogin.module, line 443
Main file for the uLogin module.

Code

function _ulogin_token_url($destination = NULL) {
  if (empty($destination)) {
    $destination = drupal_get_destination();
  }
  elseif ($destination == '[HTTP_REFERER]' && isset($_SERVER['HTTP_REFERER'])) {
    $destination = array(
      'destination' => $_SERVER['HTTP_REFERER'],
    );
  }
  else {
    $destination = array(
      'destination' => $destination,
    );
  }
  $token_url = url('ulogin', array(
    'absolute' => TRUE,
    'query' => $destination,
  ));
  return urlencode($token_url);
}