|
Lines 597-602
sub _session_log {
Link Here
|
| 597 |
close $fh; |
597 |
close $fh; |
| 598 |
} |
598 |
} |
| 599 |
|
599 |
|
|
|
600 |
sub _timeout_syspref { |
| 601 |
my $timeout = C4::Context->preference('timeout') || 600; |
| 602 |
# value in days, convert in seconds |
| 603 |
if ($timeout =~ /(\d+)[dD]/) { |
| 604 |
$timeout = $1 * 86400; |
| 605 |
}; |
| 606 |
return $timeout; |
| 607 |
} |
| 608 |
|
| 600 |
sub checkauth { |
609 |
sub checkauth { |
| 601 |
my $query = shift; |
610 |
my $query = shift; |
| 602 |
$debug and warn "Checking Auth"; |
611 |
$debug and warn "Checking Auth"; |
|
Lines 607-618
sub checkauth {
Link Here
|
| 607 |
$type = 'opac' unless $type; |
616 |
$type = 'opac' unless $type; |
| 608 |
|
617 |
|
| 609 |
my $dbh = C4::Context->dbh; |
618 |
my $dbh = C4::Context->dbh; |
| 610 |
my $timeout = C4::Context->preference('timeout'); |
619 |
my $timeout = _timeout_syspref(); |
| 611 |
# days |
|
|
| 612 |
if ($timeout =~ /(\d+)[dD]/) { |
| 613 |
$timeout = $1 * 86400; |
| 614 |
}; |
| 615 |
$timeout = 600 unless $timeout; |
| 616 |
|
620 |
|
| 617 |
_version_check($type,$query); |
621 |
_version_check($type,$query); |
| 618 |
# state variables |
622 |
# state variables |
|
Lines 1058-1065
sub check_api_auth {
Link Here
|
| 1058 |
my $flagsrequired = shift; |
1062 |
my $flagsrequired = shift; |
| 1059 |
|
1063 |
|
| 1060 |
my $dbh = C4::Context->dbh; |
1064 |
my $dbh = C4::Context->dbh; |
| 1061 |
my $timeout = C4::Context->preference('timeout'); |
1065 |
my $timeout = _timeout_syspref(); |
| 1062 |
$timeout = 600 unless $timeout; |
|
|
| 1063 |
|
1066 |
|
| 1064 |
unless (C4::Context->preference('Version')) { |
1067 |
unless (C4::Context->preference('Version')) { |
| 1065 |
# database has not been installed yet |
1068 |
# database has not been installed yet |
|
Lines 1291-1298
sub check_cookie_auth {
Link Here
|
| 1291 |
my $flagsrequired = shift; |
1294 |
my $flagsrequired = shift; |
| 1292 |
|
1295 |
|
| 1293 |
my $dbh = C4::Context->dbh; |
1296 |
my $dbh = C4::Context->dbh; |
| 1294 |
my $timeout = C4::Context->preference('timeout'); |
1297 |
my $timeout = _timeout_syspref(); |
| 1295 |
$timeout = 600 unless $timeout; |
|
|
| 1296 |
|
1298 |
|
| 1297 |
unless (C4::Context->preference('Version')) { |
1299 |
unless (C4::Context->preference('Version')) { |
| 1298 |
# database has not been installed yet |
1300 |
# database has not been installed yet |
| 1299 |
- |
|
|