Index: logintoboggan.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/logintoboggan/logintoboggan.module,v
retrieving revision 1.133.2.16
diff -u -F^f -u -F^f -r1.133.2.16 logintoboggan.module
--- logintoboggan.module	31 Aug 2009 10:52:57 -0000	1.133.2.16
+++ logintoboggan.module	30 Sep 2009 03:09:44 -0000
@@ -904,7 +904,7 @@ function logintoboggan_validate_email($u
       // Test here for a valid pre-auth -- if the pre-auth is set to the auth user, we
       // handle things a bit differently.
       $validating_id = logintoboggan_validating_id();
-      $pre_auth = $validating_id != DRUPAL_AUTHENTICATED_RID;
+      $pre_auth = !variable_get('user_email_verification', TRUE) && $validating_id != DRUPAL_AUTHENTICATED_RID;
 
       // Remove the pre-auth role from the user, unless they haven't been approved yet.
       if ($account->status) {
@@ -917,9 +917,12 @@ function logintoboggan_validate_email($u
           unset($account->roles[$validating_id]);
         }
         // Allow other modules to react to email validation by invoking the user update hook.
-        $edit = array();
-        $account->logintoboggan_email_validated = TRUE;
-        user_module_invoke('update', $edit, $account);
+        // This should only be triggered if LT's custom validation is active.
+        if (!variable_get('user_email_verification', TRUE)) {
+          $edit = array();
+          $account->logintoboggan_email_validated = TRUE;
+          user_module_invoke('update', $edit, $account);
+        }
       }
 
       // Where do we redirect after confirming the account?
@@ -1081,7 +1084,7 @@ function logintoboggan_user($op, &$edit,
       // Test here for a valid pre-auth -- if the pre-auth is set to the auth
       // user, then no further checking is necessary.
       $validating_id = logintoboggan_validating_id();
-      $pre_auth = $validating_id != DRUPAL_AUTHENTICATED_RID;
+      $pre_auth = !variable_get('user_email_verification', TRUE) && $validating_id != DRUPAL_AUTHENTICATED_RID;
       if ($pre_auth) {
         // Check to see if an admin has manually removed the pre-auth role from
         // the user.  If so, send the account activation email.
