Index: invite.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/invite/invite.module,v
retrieving revision 1.10.2.58
diff -u -r1.10.2.58 invite.module
--- invite.module	25 Jul 2007 09:33:14 -0000	1.10.2.58
+++ invite.module	27 Aug 2007 22:17:25 -0000
@@ -395,6 +395,9 @@
  * Implementation of hook_user().
  */
 function invite_user($op, &$edit, &$account, $category = NULL) {
+  global $conf;
+  global $user;
+  
   switch ($op) {
     case 'insert':
       if (isset($edit['invite_code'])) {
@@ -409,6 +412,17 @@
 
             // Approve user account
             _invite_unblock($account->uid);
+            
+            // As the account is already unblocked, temporarily switch email
+            // verification off to prevent an activation mail being sent
+            $conf['user_email_verification'] = FALSE;            
+            
+            // log the user in immediately if possible
+            if (!$user->uid) {
+              $user = $account;
+              drupal_set_message("You have been issued a temporary password. Please change your password below.");
+              drupal_goto("user/$user->uid/edit");
+            }              
           }
         }
         else {
