--- masquerade.orig	Sat Jul  8 12:00:48 2006
+++ masquerade.module	Sat Jul  8 13:36:14 2006
@@ -25,7 +25,7 @@
 function masquerade_menu($may_cache) {
   $items = array();
   if ($may_cache) {
-    global $user;
+    $default_test_user = user_load(array('name' => variable_get('masquerade_test_user', 0)));
 
     $items[] = array('path' => 'masquerade/switch', 
       'title' => t('switch user'),
@@ -33,6 +33,13 @@
       'access' => !$GLOBALS['masquerading'] && (user_access('masquerade as user') || user_access('masquerade as admin')),
       'type' => MENU_CALLBACK);
 
+    $items[] = array('path' => 'masquerade/quickswitch', 
+      'title' => t('switch to test user'),
+      'callback' => 'masquerade_switch_user',
+      'callback arguments' => array($default_test_user->uid),
+      'access' => !$GLOBALS['masquerading'] && (user_access('masquerade as user') || user_access('masquerade as admin')),
+      'type' => MENU_NORMAL_ITEM);
+
     $items[] = array('path' => 'masquerade/unswitch', 
       'title' => t('switch back'),
       'callback' => 'masquerade_switch_back',
@@ -114,6 +121,14 @@
     $rids[$obj->rid] = $obj->name;
   }
 
+  $test_user_id = variable_get('masquerade_test_user', '');
+  if (!test_user_id) {
+    $test_user = user_load(array('uid' => 1));
+  }
+  else {
+    $test_user = user_load(array('name' => $test_user_id));
+  }
+
   $form['masquerade_admin_roles'] = array(
     '#type' => 'checkboxes',
     '#title' => t("Roles that are considered 'admins' for masquerading"),
@@ -121,7 +136,25 @@
     '#options' => $rids,
   );
 
+  $form['masquerade_test_user'] = array(
+    '#type' => 'textfield',
+    '#title' => 'Default test user',
+    '#default_value' => check_plain($test_user->name),
+    '#description' => 'Enter the username of an account you wish to switch easily between. The name must be an exisiting user.',
+  );
+  
+  $form['#validate'] = array(
+    'masquerade_settings_validate' => array()
+  );
+
   return $form;
+}
+
+function masquerade_settings_validate($form_id, $form_value) {
+  $test_user = user_load(array('name' => $form_value['masquerade_test_user']));
+  if (!$test_user) {
+    form_set_error('masquerade_test_user', t('The name of the default test user is not an existing user.'));
+  }
 }
 
 /**
