add logout timeout, RT#17057
authorIvan Kohler <ivan@freeside.biz>
Tue, 5 Jun 2012 03:13:23 +0000 (20:13 -0700)
committerIvan Kohler <ivan@freeside.biz>
Tue, 5 Jun 2012 03:13:23 +0000 (20:13 -0700)
FS/FS/Conf.pm
httemplate/elements/header.html

index 4e497c1..151e31c 100644 (file)
@@ -5077,6 +5077,13 @@ and customer address. Include units.',
     'type'        => 'checkbox',
   },
 
+  {
+    'key'         => 'logout-timeout',
+    'section'     => 'UI',
+    'description' => 'If set, automatically log users out of the backoffice after this many minutes.',
+    'type'       => 'text',
+  },
+
   { key => "apacheroot", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
   { key => "apachemachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
   { key => "apachemachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
index d0ab305..c6ad3c3 100644 (file)
@@ -42,6 +42,12 @@ Example:
     <% include('init_overlib.html') |n %>
     <% include('rs_init_object.html') |n %>
     <% include('logout.html') |n %>
+%   my $timeout =  $conf->config('logout-timeout');
+%   if ( $timeout && $timeout =~ /^\s*\d+\s*$/ ) {
+      <script type="text/javascript">
+        setTimeout('logout()', <% 60000 * $timeout %>);
+      </script>
+%   }
 
     <% $head |n %>