Index: portal/portal-charon/charon/src/webapp/scripts/neoscripts.js =================================================================== --- portal/portal-charon/charon/src/webapp/scripts/neoscripts.js (revision 120897) +++ portal/portal-charon/charon/src/webapp/scripts/neoscripts.js (working copy) @@ -119,6 +119,20 @@ jQuery('#portalMask').remove(); } +function f_scrollTop() { + return f_filterResults ( + window.pageYOffset ? window.pageYOffset : 0, + document.documentElement ? document.documentElement.scrollTop : 0, + document.body ? document.body.scrollTop : 0 + ); +} +function f_filterResults(n_win, n_docel, n_body) { + var n_result = n_win ? n_win : 0; + if (n_docel && (!n_result || (n_result > n_docel))) + n_result = n_docel; + return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result; +} + /* Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net) * Licensed under the MIT License (LICENSE.txt). * @@ -150,6 +164,7 @@ if (timeoutDialogEnabled == true) { poll_session_data(); fetch_timeout_dialog(); + fetch_timeout_lapsed_dialog(); } } @@ -188,7 +203,13 @@ } else { //the timeout length has occurred, but there is a slight delay, do this until there isn't a user. - sessionTimeOut = setTimeout("poll_session_data()", 1000 * 10); + if (jQuery("#timeout_alert_body").get(0)) { + jQuery("#timeout_alert_body").remove(); + } + if (!jQuery("#session_lapsed").get(0)) { + jQuery("body").append(timeoutLapsedFragment); + jQuery('#session_lapsed').css('top', (f_scrollTop() + 100) + "px"); + } } }, error: function(XMLHttpRequest, status, error){ @@ -207,6 +228,15 @@ jQuery("#timeout_alert_body").remove(); } +function close_lapsed_dialog(){ + removeDHTMLMask(); + jQuery("#session_lapsed").remove(); +} + +function go_login() { + window.location.replace("http://" + window.location.host); +} + var timeoutDialogFragment; function fetch_timeout_dialog(){ jQuery.ajax({ @@ -222,6 +252,21 @@ }); } +var timeoutLapsedFragment; +function fetch_timeout_lapsed_dialog() { + jQuery.ajax({ + url: "/portal/timeout/lapsed", + cache: true, + dataType: "text", + success: function(data) { + timeoutLapsedFragment = data; + }, + error: function(XMLHttpRequest, status, error){ + timeoutDialogEnabled = false; + } + }); +} + function show_timeout_alert(min){ if (!timeoutDialogEnabled) { return; Index: portal/portal-render-engine-impl/pack/src/webapp/vm/neoskin/timeout.vm =================================================================== --- portal/portal-render-engine-impl/pack/src/webapp/vm/neoskin/timeout.vm (revision 120897) +++ portal/portal-render-engine-impl/pack/src/webapp/vm/neoskin/timeout.vm (working copy) @@ -1,9 +1,24 @@ -
-
-

+

+ +

+${rloader.timeout_dialog_warning_header} +

+ +

${rloader.timeout_dialog_warning_message} +

+ +

+ For your security, if an hour and twenty minutes pass and Sakai does not receive an update or page request from you, it will + automatically end your session and log you off. By automatically ending your session, the chances that a + malicious user might access Sakai with your information are greatly reduced.

-

+ +

+ Click the button below to send an update to Sakai...
+
+

-
\ No newline at end of file + +
Index: portal/portal-render-engine-impl/pack/src/webapp/vm/neoskin/lapsed.vm =================================================================== --- portal/portal-render-engine-impl/pack/src/webapp/vm/neoskin/lapsed.vm (revision 0) +++ portal/portal-render-engine-impl/pack/src/webapp/vm/neoskin/lapsed.vm (working copy) @@ -0,0 +1,38 @@ +
+ +

+${rloader.timeout_dialog_lapsed_header} +

+ +

+${rloader.timeout_dialog_lapsed_message} +

+ +

+ For your security, if an hour and twenty minutes pass and Sakai does not receive an update or page request from you, it will + automatically end your session and log you off. By automatically ending your session, the chances that a + malicious user might access Sakai with your information are greatly reduced. + +

+ If you were in the middle of writing something, completing an assignment, writing a long discussion post, + preparing an announcement, etc. you must manually save your work or it will be lost. To save your work, we + recommend: +

+ +
    +
  1. Clicking the "${rloader.timeout_dialog_closewindow}" button to close this message.
  2. +
  3. Creating a new document in your favorite text editor, e.g. Word.
  4. +
  5. Copy your text from Sakai into the new document.
  6. +
  7. Finally, login to Sakai, return to the appropriate tool, and copy your content back into Sakai. +
+ +

+ If you have any questions, please contact the eLearning Lab at (937) 229-5039. +

+ +

+

+ +

+ +
Index: portal/portal-impl/impl/src/bundle/sitenav.properties =================================================================== --- portal/portal-impl/impl/src/bundle/sitenav.properties (revision 120897) +++ portal/portal-impl/impl/src/bundle/sitenav.properties (working copy) @@ -66,11 +66,15 @@ moresite_other = OTHER moresite_unknown_term = (unknown academic term) - +timeout_dialog_warning_header = Are you still there? timeout_dialog_title = Timeout Alert timeout_dialog_warning_message = Your session will timeout in {0} minutes. timeout_dialog_keepalive = Keep My Session Active +timeout_dialog_lapsed_header = Your session has expired. +timeout_dialog_lapsed_message = Be sure to manually save any current work or it will be lost. +timeout_dialog_closewindow = Let Me Save My Work + subsite = SubSite: pda_sites = Sites Index: portal/portal-impl/impl/src/java/org/sakaiproject/portal/charon/handlers/TimeoutDialogHandler.java =================================================================== --- portal/portal-impl/impl/src/java/org/sakaiproject/portal/charon/handlers/TimeoutDialogHandler.java (revision 120897) +++ portal/portal-impl/impl/src/java/org/sakaiproject/portal/charon/handlers/TimeoutDialogHandler.java (working copy) @@ -63,6 +63,7 @@ { private static final String URL_FRAGMENT = "timeout"; private static final String CONFIG_PART = "config"; + private static final String ELAPSED_PART = "lapsed"; private ServerConfigurationService serverConfigService; @@ -97,6 +98,22 @@ } return END; } + else if ((parts.length == 3) + && parts[1].equals(TimeoutDialogHandler.URL_FRAGMENT) + && parts[2].equals(TimeoutDialogHandler.ELAPSED_PART)) { + try { + PortalRenderContext rcontext = portal.includePortal(req, res, session, + null, + /* toolId */null, req.getContextPath() + req.getServletPath(), + /* prefix */"site", /* doPages */true, /* resetTools */false, + /* includeSummary */false, /* expandSite */true); + portal.sendResponse(rcontext, res, parts[2], "text/html"); + } catch (Exception e) { + throw new PortalHandlerException(e); + } + + return END; + } else if ((parts.length >= 2) && parts[1].equals(TimeoutDialogHandler.URL_FRAGMENT)) { try {