summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-06-04 20:13:23 -0700
committerIvan Kohler <ivan@freeside.biz>2012-06-04 20:13:23 -0700
commit37805051fb90d22813cd3f5ad3995f92acdd9a72 (patch)
tree3d98503b635d08f6f6a4a130ef1905e6053682f2
parentade691aeadc1583d11ae2d09abecbce9fb15ad21 (diff)
add logout timeout, RT#17057
-rw-r--r--FS/FS/Conf.pm7
-rw-r--r--httemplate/elements/header.html6
2 files changed, 13 insertions, 0 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 4e497c1cc..151e31c7d 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -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" },
diff --git a/httemplate/elements/header.html b/httemplate/elements/header.html
index d0ab3055d..c6ad3c387 100644
--- a/httemplate/elements/header.html
+++ b/httemplate/elements/header.html
@@ -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 %>