From 16277e5299de9dfa9277a7ed32bec83daa139615 Mon Sep 17 00:00:00 2001
From: Sam Minnee <sam@silverstripe.com>
Date: Wed, 13 Oct 2010 01:36:12 +0000
Subject: [PATCH] BUGFIX: fallback to the standard authenticator before
 throwing user_error as in some cases auth  method is not passed back to the
 login form (from r102156)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112062 467b73ca-7a2a-4603-9d3b-597d59a354a9
---
 security/Security.php | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/security/Security.php b/security/Security.php
index c83628e60..5486131ef 100644
--- a/security/Security.php
+++ b/security/Security.php
@@ -237,7 +237,12 @@ class Security extends Controller {
 				return call_user_func(array($authenticator, 'get_login_form'), $this);
 			}
 		}
-
+		else {
+			if($authenticator = Authenticator::get_default_authenticator()) {
+				return call_user_func(array($authenticator, 'get_login_form'), $this);
+			}
+		}
+		
 		user_error('Passed invalid authentication method', E_USER_ERROR);
 	}