You are here

function masquerade_switch_back_page in Masquerade 6

Same name and namespace in other branches
  1. 7 masquerade.module \masquerade_switch_back_page()

Page callback that allows a user who is currently masquerading to become a new user.

2 string references to 'masquerade_switch_back_page'
masquerade_menu in ./masquerade.module
Implementation of hook_menu().
masquerade_translated_menu_link_alter in ./masquerade.module
Implementation of hook_translated_menu_link_alter().

File

./masquerade.module, line 714
masquerade.module

Code

function masquerade_switch_back_page() {
  if (isset($_GET['token']) && drupal_valid_token($_GET['token'], 'masquerade/unswitch')) {
    global $user;
    $olduser = $user;
    masquerade_switch_back();
    drupal_set_message(t('You are no longer masquerading as !masq_as and are now logged in as !user.', array(
      '!user' => theme('username', $user),
      '!masq_as' => theme('username', $olduser),
    )));
    drupal_goto(referer_uri());
  }
  else {
    drupal_access_denied();
  }
}