Commit 823a324bb83a7191dd6e2793f5b7bca8f5008c28

Authored by nbm
1 parent 7d0e2858

KTS-366: optionally refresh the page after session timeout like KT2 did.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4902 c91229c3-7414-0410-bfa2-8a42b809f60b
config/config.ini
... ... @@ -82,6 +82,10 @@ ieGIF = default
82 82 ; alwaysShowAll = false
83 83 alwaysShowAll = default
84 84  
  85 +; Set to true to automatically refresh the page after the session would
  86 +; have expired.
  87 +automaticRefresh = default
  88 +
85 89 ; ----------------------------------------------------------------
86 90 ; These sections are for more esoteric settings - you probably don't
87 91 ; want to mess with these
... ...
lib/templating/kt3template.inc.php
... ... @@ -284,6 +284,10 @@ class KTPage {
284 284 "page" => $this,
285 285 "systemversion" => $default->systemVersion,
286 286 );
  287 + $oConfig = KTConfig::getSingleton();
  288 + if ($oConfig->get("ui/automaticRefresh", false)) {
  289 + $aTemplateData['refreshTimeout'] = (int)$oConfig->get("session/sessionTimeout") + 3;
  290 + }
287 291  
288 292 // unlike the rest of KT, we use echo here.
289 293 echo $oTemplate->render($aTemplateData);
... ...
templates/kt3/standard_page.smarty
... ... @@ -12,6 +12,10 @@
12 12  
13 13 <link rel="stylesheet" type="text/css" href="{$rootUrl}/resources/css/kt-print.css"
14 14 media="print" />
  15 +
  16 +{if $refreshTimeout}
  17 + <meta http-equiv="refresh" content="{$refreshTimeout}" />
  18 +{/if}
15 19  
16 20 <!-- evil CSS workarounds - inspired by Plone's approach -->
17 21 <!-- Internet Explorer CSS Fixes -->
... ...