BUGFIX Fixed _setupPinging() javascript logic to comply to jQuery callback arguments

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92675 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-11-21 02:39:14 +00:00
parent c2d24f9022
commit 21160c6ccb

View File

@ -48,8 +48,8 @@
* It redirects back to the login form if the URL is either unreachable, or returns '0'. * It redirects back to the login form if the URL is either unreachable, or returns '0'.
*/ */
_setupPinging: function() { _setupPinging: function() {
var onSessionLost = function(response, type, XMLHttpRequest) { var onSessionLost = function(xmlhttp, status) {
if(XMLHttpRequest.status > 400 || response == 0) { if(xmlhttp.status > 400 || xmlhttp.responseText == 0) {
// TODO will pile up additional alerts when left unattended // TODO will pile up additional alerts when left unattended
if(window.open('Security/login')) { if(window.open('Security/login')) {
alert("Please log in and then try again"); alert("Please log in and then try again");
@ -64,8 +64,7 @@
jQuery.ajax({ jQuery.ajax({
url: "Security/ping", url: "Security/ping",
global: false, global: false,
error: onSessionLost, complete: onSessionLost
success: onSessionLost
}); });
}, this.PingIntervalSeconds() * 1000); }, this.PingIntervalSeconds() * 1000);
}, },