From: Moritz Bunkus Date: Wed, 16 Jan 2008 08:32:34 +0000 (+0000) Subject: Das Session-Timeout konfigurierbar gemacht; Standardwert weiterhin acht Stunden. X-Git-Tag: release-2.6.0beta1~348 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=5d275ec4487ded1246a67b626f0b61e2fbcceb16;p=kivitendo-erp.git Das Session-Timeout konfigurierbar gemacht; Standardwert weiterhin acht Stunden. --- diff --git a/SL/Auth.pm b/SL/Auth.pm index cbd90bcdb..5fb04e6d9 100644 --- a/SL/Auth.pm +++ b/SL/Auth.pm @@ -86,6 +86,9 @@ sub _read_auth_config { $self->{authenticator}->verify_config(); + $self->{session_timeout} *= 1; + $self->{session_timeout} = 8 * 60 if (!$self->{session_timeout}); + $main::lxdebug->leave_sub(); } @@ -423,7 +426,7 @@ sub restore_session { $form = $main::form; $dbh = $self->dbconnect(); - $query = qq|SELECT *, (mtime < (now() - '8h'::interval)) AS is_expired FROM auth.session WHERE id = ?|; + $query = qq|SELECT *, (mtime < (now() - '$self->{session_timeout}m'::interval)) AS is_expired FROM auth.session WHERE id = ?|; $cookie = selectfirst_hashref_query($form, $dbh, $query, $session_id); @@ -477,13 +480,13 @@ sub expire_sessions { WHERE session_id IN (SELECT id FROM auth.session - WHERE (mtime < (now() - '8h'::interval)))|; + WHERE (mtime < (now() - '$self->{session_timeout}m'::interval)))|; do_query($main::form, $dbh, $query); $query = qq|DELETE FROM auth.session - WHERE (mtime < (now() - '8h'::interval))|; + WHERE (mtime < (now() - '$self->{session_timeout}m'::interval))|; do_query($main::form, $dbh, $query); diff --git a/config/authentication.pl.default b/config/authentication.pl.default index 8e1749c7a..42b888bc2 100644 --- a/config/authentication.pl.default +++ b/config/authentication.pl.default @@ -57,4 +57,9 @@ $self->{LDAP_config} = { # Der Name des Cookies kann geändert werden, sofern gewünscht. # $self->{cookie_name} = 'lx_office_erp_session_id'; +# Die Zeitspanne, bis eine inaktive Session ungültig wird, kann +# hier geändert werden. Der Standardwert ist acht Stunden. +# Die Angabe ist in Minuten. +# $self->{session_timeout} = 8 * 60; + 1;