From a9fe1eec6a26039e9f7601199ffa3c30f4da59b2 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Wed, 24 Sep 2008 04:18:29 +0000 Subject: [PATCH] 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 --- javascript/LeftAndMain.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/javascript/LeftAndMain.js b/javascript/LeftAndMain.js index e4975784..8a5027ff 100644 --- a/javascript/LeftAndMain.js +++ b/javascript/LeftAndMain.js @@ -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); \ No newline at end of file