X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FForm.pm;h=470809f77e8df0474a5545fa5f5e158f286745d1;hb=6c4c5b35e331d732d51a3913ae7a79935a8b1e17;hp=645d7a061e1353fafe64355d7346f49f562e09d1;hpb=97422880ec1448b61c609c3d2a6257c1f5d582bf;p=kivitendo-erp.git diff --git a/SL/Form.pm b/SL/Form.pm index 645d7a061..470809f77 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -49,6 +49,7 @@ use Encode; use File::Copy; use IO::File; use Math::BigInt; +use POSIX qw(strftime); use SL::Auth; use SL::Auth::DB; use SL::Auth::LDAP; @@ -1022,16 +1023,19 @@ sub parse_template { # OUT is used for the media, screen, printer, email # for postscript we store a copy in a temporary file + my $keep_temp_files = $::lx_office_conf{debug} && $::lx_office_conf{debug}->{keep_temp_files}; + my ($temp_fh, $suffix); $suffix = $self->{IN}; $suffix =~ s/.*\.//; ($temp_fh, $self->{tmpfile}) = File::Temp::tempfile( - 'kivitendo-printXXXXXX', + strftime('kivitendo-print-%Y%m%d%H%M%S-XXXXXX', localtime()), SUFFIX => '.' . ($suffix || 'tex'), DIR => $userspath, - UNLINK => ($::lx_office_conf{debug} && $::lx_office_conf{debug}->{keep_temp_files})? 0 : 1, + UNLINK => $keep_temp_files ? 0 : 1, ); close $temp_fh; + chmod 0644, $self->{tmpfile} if $keep_temp_files; (undef, undef, $self->{template_meta}{tmpfile}) = File::Spec->splitpath( $self->{tmpfile} ); $out = $self->{OUT};