test for session timeout
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 13 Mar 2006 19:13:39 +0000 (19:13 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 13 Mar 2006 19:13:39 +0000 (19:13 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@3348 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/util/network.js

index 13a0a36..68cbde8 100644 (file)
@@ -37,6 +37,7 @@ util.network.prototype = {
                                        function(req) {
                                                obj.error.sdump('D_SES_RESULT','asynced result #' + obj.link_id + '\n\n' + 
                                                        js2JSON(req.getResultObject()));
+                                                       obj.test_session_timeout(req);
                                                f(req);
                                        }
                                );
@@ -44,6 +45,7 @@ util.network.prototype = {
                                return null;
                        } else {
                                request.send(true);
+                               obj.test_session_timeout(request);
                                var result = request.getResultObject();
                                this.error.sdump('D_SES_RESULT','synced result #' + obj.link_id + '\n\n' + js2JSON(result));
                                return result;
@@ -55,6 +57,17 @@ util.network.prototype = {
                        }
                        throw(E);
                }
+       },
+
+       'test_session_timeout' : function(req) {
+               try {
+                       var robj = req.getResultObject();
+                       if (robj.ilsevent && robj.ilsevent == 1001) {
+                               alert("Your session has timed out.  In the future we may give you the ability to log back in without losing your work, but for now, the behavior at this point is undefined and this message will almost certainly be followed by error messages.  Please logout of the staff client and then back in.");
+                       }
+               } catch(E) {
+                       this.error.sdump('D_ERROR',E);
+               }
        }
 }