Index: crowd.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/crowd/crowd.admin.inc,v
retrieving revision 1.1.2.8
diff -u -r1.1.2.8 crowd.admin.inc
--- crowd.admin.inc	8 Apr 2010 13:34:09 -0000	1.1.2.8
+++ crowd.admin.inc	22 Sep 2010 15:11:44 -0000
@@ -57,6 +57,13 @@
     '#description' => t('Enter the password used by your application to authenticate with Crowd'),
   );
   
+  $form['server']['crowd_login_failover'] = array(
+    '#type' => 'checkbox',
+	'#title' => t('Crowd Failover to Drupal'),
+	'#default_value' => variable_get('crowd_login_failover', ''),
+	'#description' => 'If enabled Drupal authentication will be used if authentication fails with the Crowd server.',
+  );
+  
   $form['server']['cookie_options'] = array(
     '#type' => 'fieldset',
     '#title' => t('SSO Cookie Options'),
Index: crowd.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/crowd/crowd.module,v
retrieving revision 1.1.2.12
diff -u -r1.1.2.12 crowd.module
--- crowd.module	2 Sep 2010 00:35:02 -0000	1.1.2.12
+++ crowd.module	22 Sep 2010 15:10:51 -0000
@@ -19,6 +19,8 @@
 define('CROWD_LOGOUT_NO_COOKIE', variable_get('crowd_logout_no_cookie', false));
 define('CROWD_VALIDATE_TOKEN', variable_get('crowd_validate_token', false));
 
+define('CROWD_LOGIN_FAILOVER', variable_get('crowd_login_failover', 1));
+
 /**
  * Implementation of hook_init()
  * Traps a page load to see if authentication is required.
@@ -158,8 +160,17 @@
       
       // Finalize the login process. Must be called when logging in a user.
       user_authenticate_finalize($form_state['values']);
-            
     }
+	else { 
+	  if (CROWD_LOGIN_FAILOVER) {
+         /**
+          * Failover mode is enabled, allow login to drupal if login failed for crowd.
+          * Normally exceptions are handled further up in the stack so don't rely on exceptions for this logic.
+          */
+        $crowd_auth = FALSE;
+        user_authenticate($form_state['values']);
+      }
+	}
   }
   catch(Exception $e) {
     // Crowd Authentication failed
