Index: skeleton_instance.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/skeleton/skeleton_instance.inc,v
retrieving revision 1.11
diff -u -r1.11 skeleton_instance.inc
--- skeleton_instance.inc	11 Jan 2009 23:05:34 -0000	1.11
+++ skeleton_instance.inc	12 Jan 2009 03:05:34 -0000
@@ -431,6 +431,16 @@
       break;
     }
   }
+  $form['instance']['author'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Book author'),
+    '#description' => t('Select an author for the created book, or leave blank to set yourself as the author.'),
+    '#access' => user_access('set outline authors'),
+    '#default_value' => $form_values['author'],
+    '#size' => 40,
+    '#autocomplete_path' => 'user/autocomplete',
+    '#weight' => -50,
+  );
   if ($parents_count < 2 && (!$form_state['add_introduction'])) {
     $form['instance']['add_introduction'] = array(
       '#type' => 'submit',
@@ -442,8 +452,11 @@
         'wrapper' => 'introduction-wrapper',
       ),
       '#submit' => array('skeleton_add_introduction_submit'), // If no javascript action.
-      '#suffix' => '<div id="introduction-wrapper" style="clear: both;" />',
-      '#weight' => -100,
+      '#weight' => 100,
+    );
+    $form['instance']['introduction_wrapper'] = array(
+      '#value' => '<div id="introduction-wrapper" /></div>',
+      '#weight' => -25,
     );
   }
   else {
@@ -514,6 +527,11 @@
   if (!($form_state['clicked_button']['#value'] == t('Create new book from skeleton'))) {
     return;
   }
+  if (!empty($form_state['values']['author'])) {
+    if (!user_load(array('name' => $form_state['values']['author']))) {
+      form_set_error('author', t('The account %user you selected as the author does not exist.', array('%user' => $form_state['values']['author'])));
+    }
+  }
   if (isset($form['instance']['title'])) {
     if (empty($form_state['values']['title'])) {
       form_set_error('title', t('You must set a title for the custom introduction.'));
@@ -645,6 +663,7 @@
   // Render the new output. 
   $introduction_form = $form['instance'];
   unset($introduction_form['add_introduction']);
+  unset($introduction_form['author']);
   unset($introduction_form['#type']);
   $output = drupal_render($introduction_form);
   drupal_json(array('status' => TRUE, 'data' => $output));
@@ -658,10 +677,17 @@
  * 
  */
 function skeleton_create_instance_form_submit($form, &$form_state) {
-  global $user;
   module_load_include('inc', 'node', 'node.pages');
   module_load_include('inc', 'skeleton', 'skeleton_token');
 
+  // Use the author as specified, otherwise default to the current user.
+  if (!empty($form_state['values']['author'])) {
+    $user = user_load(array('name' => $form_state['values']['author']));
+  }
+  else {
+    global $user;
+  }
+
   $nodes = skeleton_get_tree($form_state['values']['skeleton_id']);
   if (!empty($nodes)) {
     $parents = array();
@@ -730,6 +756,9 @@
       $node['values']['body'] = token_replace($node['values']['body'], 'skeleton', $form_state['values']['skeleton_tokens']);
       $node['values']['body'] = token_replace($node['values']['body'], 'node', (object)$form_state['values']);
 
+      $node['values']['uid'] = $user->uid;
+      $node['values']['name'] = $user->name;
+
       $node['values']['op'] = t('Save');
       drupal_execute($node['values']['type'] .'_node_form', $node, (object)$node['values']);
       // Store all of the menu id's for each inserted template.
Index: skeleton.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/skeleton/skeleton.module,v
retrieving revision 1.14
diff -u -r1.14 skeleton.module
--- skeleton.module	11 Jan 2009 23:05:34 -0000	1.14
+++ skeleton.module	12 Jan 2009 03:05:32 -0000
@@ -28,7 +28,7 @@
  * Implements hook_perm()
  */
 function skeleton_perm() {
-  return array('configure skeleton outlines', 'create new instances');
+  return array('configure skeleton outlines', 'create new instances', 'set outline authors');
 }
 
 /**
Index: skeleton-admin.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/skeleton/skeleton-admin.js,v
retrieving revision 1.1
diff -u -r1.1 skeleton-admin.js
--- skeleton-admin.js	11 Jan 2009 23:05:34 -0000	1.1
+++ skeleton-admin.js	12 Jan 2009 03:05:32 -0000
@@ -2,7 +2,11 @@
   // If JS is enabled, then override the submit handler so that enter presses
   // on textfields don't trigger the no-JS fallback.
   $("form#skeleton-create-instance-form #edit-add-introduction").click(function(){
-    $("form#skeleton-create-instance-form #edit-submit").click();
+    // If any autocomplete fields are open, don't submit so the enter key can
+    // be used to select an option.
+    if ($("#autocomplete").length == 0) {
+      $("form#skeleton-create-instance-form #edit-submit").click();
+    }
     return false;
   });
 });
