From a9ad1e79c1dcb0b83f65d4bb67dcf75f843a4532 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Wed, 24 Sep 2008 04:17:33 +0000 Subject: [PATCH] ENHANCEMENT: Prevent CMS session timing out and losing content - Added Security/ping as a destination for session-preserving ajax pings git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@62994 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- security/Security.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/security/Security.php b/security/Security.php index bb59e5332..3eae5e660 100644 --- a/security/Security.php +++ b/security/Security.php @@ -353,8 +353,7 @@ class Security extends Controller { $member = BasicAuth::requireLogin("SilverStripe login", 'ADMIN'); $member->LogIn(); } - - + /** * Show the "lost password" page * @@ -505,6 +504,14 @@ class Security extends Controller { //Controller::$currentController = $controller; return $customisedController->renderWith($this->stat('template_main')); } + + /** + * Security/ping can be visited with ajax to keep a session alive. + * This is used in the CMS. + */ + function ping() { + return 1; + } /**