Index: edit_authoring_info.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/edit_authoring_info/edit_authoring_info.info,v
retrieving revision 1.1
diff -u -r1.1 edit_authoring_info.info
--- edit_authoring_info.info	9 Sep 2007 02:09:32 -0000	1.1
+++ edit_authoring_info.info	7 Nov 2008 20:51:54 -0000
@@ -1,3 +1,5 @@
 ; $Id: edit_authoring_info.info,v 1.1 2007/09/09 02:09:32 davidlesieur Exp $
 name = Edit Authoring Information
 description = Allows users with the right permissions to edit a node's author and/or date authored field.
+package = Administration
+core = 6.x
\ No newline at end of file
Index: edit_authoring_info.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/edit_authoring_info/edit_authoring_info.module,v
retrieving revision 1.2
diff -u -r1.2 edit_authoring_info.module
--- edit_authoring_info.module	9 Sep 2007 02:09:32 -0000	1.2
+++ edit_authoring_info.module	7 Nov 2008 20:58:13 -0000
@@ -1,6 +1,10 @@
 <?php
 // $Id: edit_authoring_info.module,v 1.2 2007/09/09 02:09:32 davidlesieur Exp $
-
+/*
+ * @file
+ * Allows users with the right permissions to edit a node's author and/or date authored field.
+ */
+ 
 /**
  * Implementation of hook_perm().
  */
@@ -11,7 +15,7 @@
 /**
  * Implementation of hook_form_alter().
  */
-function edit_authoring_info_form_alter($form_id, &$form) {
+function edit_authoring_info_form_alter(&$form, &$form_state, $form_id) {
   if (isset($form['type']) && $form_id == $form['type']['#value'] .'_node_form') {
     // Check 'administer nodes' to avoid conflict with the core code
     if (!user_access('administer nodes') && (user_access('edit date authored') || user_access('edit author'))) {
@@ -57,7 +61,7 @@
         );
       }
       
-      $form['#validate']['edit_authoring_info_form_validate'] = current($form['#validate']);
+      $form['#element_validate']['edit_authoring_info_form_validate'] = current($form['#validate']);
     }
   }
 }
@@ -65,16 +69,16 @@
 /**
  * Callback for form validation.
  */
-function edit_authoring_info_form_validate($form_id, $form_values) {
+function edit_authoring_info_form_validate($form, &$form_state) {
   if (user_access('edit date authored')) {
     // Validate the "authored on" field. As of PHP 5.1.0, strtotime returns FALSE instead of -1 upon failure.
-    if (!empty($form_values['date']) && strtotime($form_values['date']) <= 0) {
+    if (!empty($form_state['values']['date']) && strtotime($form_state['values']['date']) <= 0) {
       form_set_error('date', t('You have to specify a valid date.'));
     }
   }
   if (user_access('edit author')) {
     // Validate the "authored by" field.
-    if (!empty($form_values['name']) && !($account = user_load(array('name' => $form_values['name'])))) {
+    if (!empty($form_state['values']['name']) && !($account = user_load(array('name' => $form_state['values']['name'])))) {
       // The use of empty() is mandatory in the context of usernames
       // as the empty string denotes the anonymous user.  In case we
       // are dealing with an anonymous user we set the user ID to 0.
@@ -88,7 +92,7 @@
  */
 function edit_authoring_info_nodeapi(&$node, $op) {
   // Check 'administer nodes' to avoid conflict with the core code
-  if ($op == 'submit' && !user_access('administer nodes')) {
+  if ($op == 'presave' && !user_access('administer nodes')) {
     if (user_access('edit date authored')) {
       // Populate the "authored on" field
       $node->created = $node->date ? strtotime($node->date) : NULL;
