--- webform_original.module	2010-06-01 15:49:43.000000000 +0000
+++ webform_modefied.module	2010-06-01 15:49:43.000000000 +0000
@@ -486,6 +486,7 @@
     'access own webform submissions',
     'edit own webform submissions',
     'delete own webform submissions',
+    'change submission author',
   );
 }
 
@@ -1063,6 +1064,41 @@
       $form['actions']['submit']['#submit'][] = 'webform_form_submit';
     }
   }
+  // Check if the user has 'change submission author' permisssion
+  if (user_access('change submission author')) {
+    // Check if the form has nid
+    if (isset($form['details']['nid']['#value']) && !empty($form['details']['nid']['#value'])) {
+      // Check if the form id equal webform_client_form_nid
+      if ($form_id = 'webform_client_form_' . $form['details']['nid']['#value']) {
+        global $user;
+
+        // Add Administration fieldset to the form
+        $form['admin']['#type'] = 'fieldset';
+        $form['admin']['#title'] = 'Administration';
+        $form['admin']['#collapsible'] = 1;
+        $form['admin']['#collapsed'] = 1;
+        $form['admin']['#weight'] = -2;
+
+        // Add Authored by textfield to the form
+        $form['admin']['author']['#type'] = 'textfield';
+        $form['admin']['author']['#title'] = 'Authored by';
+        $form['admin']['author']['#size'] = 30;
+        $form['admin']['author']['#maxlength'] = 60;
+        $form['admin']['author']['#autocomplete_path'] = 'user/autocomplete';
+        $form['admin']['author']['#default_value'] = $user->name;
+        $form['admin']['author']['#weight'] = -1;
+
+        // Add Authored on textfield to the form
+        $form['admin']['date']['#type'] = 'textfield';
+        $form['admin']['date']['#parents'][0] = 'date';
+        $form['admin']['date']['#title'] = 'Authored on';
+        $form['admin']['date']['#size'] = 20;
+        $form['admin']['date']['#maxlength'] = 25;
+        $form['admin']['date']['#default_value'] = date('Y-m-d h:m', time());
+        $form['admin']['date']['#weight'] = -1;
+      }
+    }
+  }
 }
 
 /**
@@ -1800,10 +1836,26 @@
   $is_draft = $form_state['values']['op'] == t('Save Draft');
 
   // Create a submission object.
+  // Check if submission auther is edited or not
+  if (isset($form['#post']['author']) && !empty($form['#post']['author'])) {
+    $submited_user = user_load(array('name' => $form['#post']['author']));
+    $submited_uid = $submited_user->uid;
+  }
+  else {
+    $submited_uid = $user->uid;
+  }
+  // Check if submission date is edited or not
+  if (isset($form['#post']['date']) && !empty($form['#post']['date'])) {
+    $submited_time = strtotime($form['#post']['date']);
+  }
+  else {
+    $submited_time = time();
+  }
+
   $submission = (object) array(
     'nid' => $node->nid,
-    'uid' => $user->uid,
-    'submitted' => time(),
+    'uid' => $submited_uid,
+    'submitted' => $submited_time,
     'remote_addr' => ip_address(),
     'is_draft' => $is_draft,
     'data' => webform_submission_data($node, $form_state['values']['submitted']),
