summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-06-04 20:13:25 -0700
committerIvan Kohler <ivan@freeside.biz>2012-06-04 20:13:25 -0700
commit63dcb8667f24d728393efc878b7de1ec21458e98 (patch)
tree0e5937db2fc22c4a06934b1a258c9550be164c2e
parent5c6e504c42a3cc14c29dd9d78541d42efcfc1c09 (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 a58218b37..aae5f6401 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -5041,6 +5041,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 %>