Merge pull request #50 from mateusz/prevent-expiry-master

BUGFIX: prevent form from expiring on users - ping regularly.
This commit is contained in:
Will Rossiter 2012-09-10 20:40:45 -07:00
commit a38729073f
2 changed files with 17 additions and 0 deletions

View File

@ -298,6 +298,7 @@ class UserDefinedForm_Controller extends Page_Controller {
// load the jquery
Requirements::javascript(FRAMEWORK_DIR .'/thirdparty/jquery/jquery.js');
Requirements::javascript('userforms/thirdparty/jquery-validate/jquery.validate.min.js');
Requirements::javascript('userforms/javascript/UserForm_frontend.js');
}
/**
@ -325,6 +326,13 @@ class UserDefinedForm_Controller extends Page_Controller {
);
}
/**
* Keep the session alive for the user.
*/
function ping() {
return 1;
}
/**
* Get the form for the page. Form can be modified by calling {@link updateForm()}
* on a UserDefinedForm extension

View File

@ -0,0 +1,9 @@
jQuery(function($) {
/**
* Make sure the form does not expire on the user.
*/
setInterval(function() {
// Ping every 3 mins.
$.ajax({url: "UserDefinedForm_Controller/ping"});
}, 180*1000);
});