|
Lines 762-773
sub _session_log {
Link Here
|
| 762 |
} |
762 |
} |
| 763 |
|
763 |
|
| 764 |
sub _timeout_syspref { |
764 |
sub _timeout_syspref { |
| 765 |
my $timeout = C4::Context->preference('timeout') || 600; |
765 |
my $default_timeout = 600; |
|
|
766 |
my $timeout = C4::Context->preference('timeout') || $default_timeout; |
| 766 |
|
767 |
|
| 767 |
# value in days, convert in seconds |
768 |
# value in days, convert in seconds |
| 768 |
if ( $timeout =~ /(\d+)[dD]/ ) { |
769 |
if ( $timeout =~ /^(\d+)[dD]$/ ) { |
| 769 |
$timeout = $1 * 86400; |
770 |
$timeout = $1 * 86400; |
| 770 |
} |
771 |
} |
|
|
772 |
# value in hours, convert in seconds |
| 773 |
elsif ( $timeout =~ /^(\d+)[hH]$/ ) { |
| 774 |
$timeout = $1 * 3600; |
| 775 |
} |
| 776 |
elsif ( $timeout !~ m/^\d+$/ ) { |
| 777 |
warn "The value of the system preference 'timeout' is not correct, defaulting to $default_timeout"; |
| 778 |
$timeout = $default_timeout; |
| 779 |
} |
| 780 |
|
| 771 |
return $timeout; |
781 |
return $timeout; |
| 772 |
} |
782 |
} |
| 773 |
|
783 |
|
| 774 |
- |
|
|