Bugzilla – Attachment 12645 Details for
Bug 8497
Strange behavior when modifying the 'timeout' system preference.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 8497: Strange behavior when modifying the timeout system preference
SIGNED-OFF-Bug-8497-Strange-behavior-when-modifyin.patch (text/plain), 2.04 KB, created by
Owen Leonard
on 2012-10-02 14:57:56 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 8497: Strange behavior when modifying the timeout system preference
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2012-10-02 14:57:56 UTC
Size:
2.04 KB
patch
obsolete
>From 7dcead222fd01bbc79e3ba398e9521feff6d3174 Mon Sep 17 00:00:00 2001 >From: Fridolyn SOMERS <fridolyn.somers@biblibre.com> >Date: Tue, 2 Oct 2012 13:49:32 +0200 >Subject: [PATCH] [SIGNED-OFF] Bug 8497: Strange behavior when modifying the > timeout system preference >Content-Type: text/plain; charset="utf-8" > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >Tested standard login, patron auto-complete, and system preferences. >--- > C4/Auth.pm | 22 ++++++++++++---------- > 1 file changed, 12 insertions(+), 10 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 5486f76..eb1474a 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -597,6 +597,15 @@ sub _session_log { > close $fh; > } > >+sub _timeout_syspref { >+ my $timeout = C4::Context->preference('timeout') || 600; >+ # value in days, convert in seconds >+ if ($timeout =~ /(\d+)[dD]/) { >+ $timeout = $1 * 86400; >+ }; >+ return $timeout; >+} >+ > sub checkauth { > my $query = shift; > $debug and warn "Checking Auth"; >@@ -607,12 +616,7 @@ sub checkauth { > $type = 'opac' unless $type; > > my $dbh = C4::Context->dbh; >- my $timeout = C4::Context->preference('timeout'); >- # days >- if ($timeout =~ /(\d+)[dD]/) { >- $timeout = $1 * 86400; >- }; >- $timeout = 600 unless $timeout; >+ my $timeout = _timeout_syspref(); > > _version_check($type,$query); > # state variables >@@ -1058,8 +1062,7 @@ sub check_api_auth { > my $flagsrequired = shift; > > my $dbh = C4::Context->dbh; >- my $timeout = C4::Context->preference('timeout'); >- $timeout = 600 unless $timeout; >+ my $timeout = _timeout_syspref(); > > unless (C4::Context->preference('Version')) { > # database has not been installed yet >@@ -1291,8 +1294,7 @@ sub check_cookie_auth { > my $flagsrequired = shift; > > my $dbh = C4::Context->dbh; >- my $timeout = C4::Context->preference('timeout'); >- $timeout = 600 unless $timeout; >+ my $timeout = _timeout_syspref(); > > unless (C4::Context->preference('Version')) { > # database has not been installed yet >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8497
:
12629
| 12645