Skip to content
This repository has been archived by the owner on May 13, 2018. It is now read-only.

Commit

Permalink
#1010240 by merlinofchaos, voxpelli: Redirect user back to page where…
Browse files Browse the repository at this point in the history
… he logged in
  • Loading branch information
voxpelli committed Jan 15, 2011
1 parent 610b750 commit 23bf6c6
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions oauthconnector.module
Expand Up @@ -145,6 +145,11 @@ function oauthconnector_oauth_common_authorized($consumer_token, $access_token,
if (empty($info['real name'])) { if (empty($info['real name'])) {
_connector_information_update($user->uid, array('real name' => TRUE)); _connector_information_update($user->uid, array('real name' => TRUE));
} }
if (!empty($_SESSION['oauthconnector_destination'])) {
$_REQUEST['destination'] = $_SESSION['oauthconnector_destination'];
unset($_SESSION['oauthconnector_destination']);
drupal_goto();
}
} }
} }
else { else {
Expand Down Expand Up @@ -356,6 +361,24 @@ function _oauthconnector_button($form, &$form_state) {
'callback' => $callback_url, 'callback' => $callback_url,
)); ));


if (isset($_REQUEST['destination'])) {
$destination = $_REQUEST['destination'];
unset($_REQUEST['destination']);
}
elseif (isset($_REQUEST['edit']['destination'])) {
$destination = $_REQUEST['edit']['destination'];
unset($_REQUEST['edit']['destination']);
}
else {
$destination = isset($_GET['q']) ? $_GET['q'] : '';
$query = drupal_query_string_encode($_GET, array('q'));
if ($query != '') {
$destination .= '?'. $query;
}
}

$_SESSION['oauthconnector_destination'] = $destination;

drupal_goto($auth_url); drupal_goto($auth_url);
} }


Expand Down

0 comments on commit 23bf6c6

Please sign in to comment.