Index: invite.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/invite/invite.module,v
retrieving revision 1.10.2.60
diff -u -r1.10.2.60 invite.module
--- invite.module	27 Aug 2007 04:47:52 -0000	1.10.2.60
+++ invite.module	29 Aug 2007 01:54:29 -0000
@@ -340,16 +340,33 @@
       }
 
       if ($invite) {
-        // Preset email field, taking 3rd party added fields into account
+        // Figure out destination
         if (isset($form['account'])) {
           $field = &$form['account'];
         }
         else {
           $field = &$form;
         }
+
+        // Preset email field
         if (isset($field['mail'])) {
           $field['mail']['#default_value'] = $invite->email;
         }
+
+        // Add back password fields if required to prevent another validation
+        // email being sent
+        if (variable_get('user_email_verification', TRUE)) {
+          $field['pass'] = array(
+            '#type' => 'password_confirm',
+            '#description' => t('Provide a password for the new account in both fields.'),
+            '#required' => TRUE,
+            '#size' => 25,
+          );
+
+          // Prepend our register_submit handler, so it gets executed before
+          // user_register_submit()
+          $form['#submit'] = array('invite_register_submit' => array()) + $form['#submit'];
+        }
       }
       else if (variable_get('user_register', 1) == 'inviteonly') {
         drupal_set_message(t('Sorry, new user registration by invitation only.'));
@@ -369,6 +386,18 @@
 }
 
 /**
+ * Temporarily switch off email verification.
+ *
+ * As the account will already be unblocked, switch off email verification
+ * to get the password saved correctly and prevent another activation
+ * email being sent. This must happen before user_register_submit().
+ */
+function invite_register_submit($form_id, $form_values) {
+  global $conf;
+  $conf['user_email_verification'] = FALSE;
+}
+
+/**
  * Implementation of hook_user().
  */
 function invite_user($op, &$edit, &$account, $category = NULL) {

