You are here

function devel_switch_user_form_submit in Devel 6

Same name and namespace in other branches
  1. 5 devel.module \devel_switch_user_form_submit()
  2. 7 devel.module \devel_switch_user_form_submit()

File

./devel.module, line 792

Code

function devel_switch_user_form_submit($form, &$form_state) {
  $path = 'devel/switch/' . $form_state['values']['username'];
  $dest = drupal_get_destination();
  $dest_value = urldecode(substr($dest, strlen('destination=')));
  $form_state['redirect'] = array(
    $path,
    array(
      'token' => drupal_get_token($path . '|' . $dest_value),
      'destination' => $dest_value,
    ),
  );
}