mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Added Secuirty::set_default_login_dest() for developers to specify the default page to direct to after the log in
This results in more reliable log-in redirection git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@62653 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
a6577d9749
commit
c20c4ae6b0
@ -109,7 +109,7 @@ class MemberLoginForm extends LoginForm {
|
||||
Session::clear("BackURL");
|
||||
Director::redirect($backURL);
|
||||
} else {
|
||||
Director::redirectBack();
|
||||
Director::redirect(Security::default_login_dest());
|
||||
}
|
||||
} else {
|
||||
Session::set('SessionForms.MemberLoginForm.Email', $data['Email']);
|
||||
|
@ -927,6 +927,26 @@ class Security extends Controller {
|
||||
public static function login_recording() {
|
||||
return self::$login_recording;
|
||||
}
|
||||
|
||||
protected static $default_login_dest = "";
|
||||
|
||||
/**
|
||||
* Set the default login dest
|
||||
* This is the URL that users will be redirected to after they log in,
|
||||
* if they haven't logged in en route to access a secured page.
|
||||
*
|
||||
* By default, this is set to the homepage
|
||||
*/
|
||||
public static function set_default_login_dest($dest) {
|
||||
self::$default_login_dest = $dest;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default login dest
|
||||
*/
|
||||
public static function default_login_dest() {
|
||||
return self::$default_login_dest;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user