mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge pull request #929 from halkyon/3.0
BUG Fixing session keep alive for non-ADMIN users
This commit is contained in:
commit
6a4b8cb6ef
@ -80,7 +80,6 @@ class LeftAndMain extends Controller implements PermissionProvider {
|
|||||||
'updatetreenodes',
|
'updatetreenodes',
|
||||||
'printable',
|
'printable',
|
||||||
'show',
|
'show',
|
||||||
'ping',
|
|
||||||
'EditorToolbar',
|
'EditorToolbar',
|
||||||
'EditForm',
|
'EditForm',
|
||||||
'AddForm',
|
'AddForm',
|
||||||
@ -398,15 +397,6 @@ class LeftAndMain extends Controller implements PermissionProvider {
|
|||||||
return $this->getResponseNegotiator()->respond($request);
|
return $this->getResponseNegotiator()->respond($request);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* admin/ping can be visited with ajax to keep a session alive.
|
|
||||||
* This is used in the CMS.
|
|
||||||
*/
|
|
||||||
public function ping() {
|
|
||||||
Requirements::clear();
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If this is set to true, the "switchView" context in the
|
* If this is set to true, the "switchView" context in the
|
||||||
* template is shown, with links to the staging and publish site.
|
* template is shown, with links to the staging and publish site.
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
// setup pinging for login expiry
|
// setup pinging for login expiry
|
||||||
setInterval(function() {
|
setInterval(function() {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: 'admin/security/ping',
|
url: 'Security/ping',
|
||||||
global: false,
|
global: false,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
complete: onSessionLost
|
complete: onSessionLost
|
||||||
|
@ -14,6 +14,7 @@ class Security extends Controller {
|
|||||||
'lostpassword',
|
'lostpassword',
|
||||||
'passwordsent',
|
'passwordsent',
|
||||||
'changepassword',
|
'changepassword',
|
||||||
|
'ping',
|
||||||
'LoginForm',
|
'LoginForm',
|
||||||
'ChangePasswordForm',
|
'ChangePasswordForm',
|
||||||
'LostPasswordForm',
|
'LostPasswordForm',
|
||||||
@ -294,6 +295,13 @@ class Security extends Controller {
|
|||||||
return "Security/$action";
|
return "Security/$action";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This action is available as a keep alive, so user
|
||||||
|
* sessions don't timeout. A common use is in the admin.
|
||||||
|
*/
|
||||||
|
public function ping() {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Log the currently logged in user out
|
* Log the currently logged in user out
|
||||||
|
Loading…
x
Reference in New Issue
Block a user