mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-03 14:48:38 +02:00
#1457 - Redirection after login doesn't behave correctly if login fails (merged from 2.1.1 branch, r43601)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@44197 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
a462cd2c20
commit
1509d413e5
@ -102,13 +102,17 @@ class MemberLoginForm extends LoginForm {
|
|||||||
if($backURL = $_REQUEST['BackURL']) {
|
if($backURL = $_REQUEST['BackURL']) {
|
||||||
Session::clear("BackURL");
|
Session::clear("BackURL");
|
||||||
Director::redirect($backURL);
|
Director::redirect($backURL);
|
||||||
} else
|
} else {
|
||||||
Director::redirectBack();
|
Director::redirectBack();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Session::set('SessionForms.MemberLoginForm.Email', $data['Email']);
|
Session::set('SessionForms.MemberLoginForm.Email', $data['Email']);
|
||||||
Session::set('SessionForms.MemberLoginForm.Remember',
|
Session::set('SessionForms.MemberLoginForm.Remember', isset($data['Remember']));
|
||||||
isset($data['Remember']));
|
|
||||||
|
if(isset($_REQUEST['BackURL']) && $backURL = $_REQUEST['BackURL']) {
|
||||||
|
Session::set('BackURL', $backURL);
|
||||||
|
}
|
||||||
|
|
||||||
if($badLoginURL = Session::get("BadLoginURL")) {
|
if($badLoginURL = Session::get("BadLoginURL")) {
|
||||||
Director::redirect($badLoginURL);
|
Director::redirect($badLoginURL);
|
||||||
} else {
|
} else {
|
||||||
@ -193,4 +197,4 @@ class MemberLoginForm extends LoginForm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@ -108,15 +108,17 @@ class OpenIDLoginForm extends LoginForm {
|
|||||||
OpenIDAuthenticator::authenticate($data, $this);
|
OpenIDAuthenticator::authenticate($data, $this);
|
||||||
|
|
||||||
// If the OpenID authenticator returns, an error occured!
|
// If the OpenID authenticator returns, an error occured!
|
||||||
Session::set('SessionForms.OpenIDLoginForm.OpenIDURL',
|
Session::set('SessionForms.OpenIDLoginForm.OpenIDURL', $data['OpenIDURL']);
|
||||||
$data['OpenIDURL']);
|
|
||||||
|
if(isset($_REQUEST['BackURL']) && $backURL = $_REQUEST['BackURL']) {
|
||||||
|
Session::set('BackURL', $backURL);
|
||||||
|
}
|
||||||
|
|
||||||
if($badLoginURL = Session::get("BadLoginURL")){
|
if($badLoginURL = Session::get("BadLoginURL")){
|
||||||
Director::redirect($badLoginURL);
|
Director::redirect($badLoginURL);
|
||||||
} else {
|
} else {
|
||||||
// Show the right tab on failed login
|
// Show the right tab on failed login
|
||||||
Director::redirect(Director::absoluteURL(Security::Link("login")) .
|
Director::redirect(Director::absoluteURL(Security::Link("login")) . '#' . $this->FormName() .'_tab');
|
||||||
'#' . $this->FormName() .'_tab');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,4 +139,4 @@ class OpenIDLoginForm extends LoginForm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
Loading…
Reference in New Issue
Block a user