- open L, ">>/tmp/sessionlog" or warn "ERROR: Cannot append to /tmp/sessionlog";
- printf L join("\n",@_);
- close L;
+ open my $fh, '>>', "/tmp/sessionlog" or warn "ERROR: Cannot append to /tmp/sessionlog";
+ printf $fh join("\n",@_);
+ 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;