ENHANCEMENT: Prevent CMS session timing out and losing content - Added a ping to Security/ping every 5 mins, and altered the onSessionLost behaviour to open login form in a pop-up instead of closing the CMS (see #2242)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@62995 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-09-24 04:18:29 +00:00
parent 366ceda590
commit a9fe1eec6a

View File

@ -788,8 +788,12 @@ showResponseAsSuccessMessage = function(response) {
* It redirects back to the login form.
*/
function onSessionLost() {
alert("You've been logged out of the server, so we're going to send you back to the log-in screen.");
window.location.reload(true);
w = window.open('Security/login');
if(w) {
alert("Please log in and then try again");
} else {
alert("Please enable pop-ups for this site");
}
}
var _CURRENT_CONTEXT_MENU = null;
@ -875,3 +879,7 @@ function showIndicator(id, container, imgSrc, insertionType, displayType) {
function hideIndicator(id) {
Effect.Fade(id, {duration: 0.3});
}
setInterval(function() {
new Ajax.Request("Security/ping");
}, 5*60*1000);