#1457 - Redirection after login doesn't behave correctly if login fails

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.1.1@43599 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew O'Neil 2007-10-18 23:41:30 +00:00 committed by Sam Minnee
parent 99b3728e6d
commit b9492c67c5

View File

@ -50,9 +50,13 @@ class LoginForm extends Form {
if(isset($_REQUEST['BackURL']) && $backURL = $_REQUEST['BackURL']) {
Session::clear("BackURL");
Director::redirect($backURL);
}else
Director::redirectBack();
} else {
Director::redirectBack();
}
} else {
if(isset($_REQUEST['BackURL']) && $backURL = $_REQUEST['BackURL']) {
Session::set('BackURL', $backURL);
}
if($badLoginURL = Session::get("BadLoginURL")) {
Director::redirect($badLoginURL);