]> wagnertech.de Git - kivitendo-erp.git/blobdiff - SL/Form.pm
Secure Cookies.
[kivitendo-erp.git] / SL / Form.pm
index b112ea7885acab1a01ab7d037a02f1d7834aeac3..4febdc72a61e9b9402c41ddb66f9a80cd7553b53 100644 (file)
@@ -57,6 +57,7 @@ use SL::Template;
 use SL::User;
 use Template;
 use List::Util qw(first max min sum);
+use List::MoreUtils qw(any);
 
 my $standard_dbh;
 
@@ -255,7 +256,7 @@ sub _recode_recursively {
   $main::lxdebug->enter_sub();
   my ($iconv, $param) = @_;
 
-  if (ref $param eq 'HASH') {
+  if (any { ref $param eq $_ } qw(Form HASH)) {
     foreach my $key (keys %{ $param }) {
       if (!ref $param->{$key}) {
         $param->{$key} = $iconv->convert($param->{$key});
@@ -606,9 +607,10 @@ sub create_http_response {
     my $session_cookie_value   = $main::auth->get_session_id();
     $session_cookie_value    ||= 'NO_SESSION';
 
-    $session_cookie = $cgi->cookie('-name'  => $main::auth->get_session_cookie_name(),
-                                   '-value' => $session_cookie_value,
-                                   '-path'  => $base_path);
+    $session_cookie = $cgi->cookie('-name'   => $main::auth->get_session_cookie_name(),
+                                   '-value'  => $session_cookie_value,
+                                   '-path'   => $base_path,
+                                   '-secure' => $ENV{HTTPS});
   }
 
   my %cgi_params = ('-type' => $params{content_type});
@@ -1194,7 +1196,7 @@ sub parse_template {
 
   if ($self->{"format"} =~ /(opendocument|oasis)/i) {
     $template       = OpenDocumentTemplate->new($self->{"IN"}, $self, $myconfig, $userspath);
-    $ext_for_format = 'odt';
+    $ext_for_format = $self->{"format"} =~ m/pdf/ ? 'pdf' : 'odt';
 
   } elsif ($self->{"format"} =~ /(postscript|pdf)/i) {
     $ENV{"TEXINPUTS"} = ".:" . getcwd() . "/" . $myconfig->{"templates"} . ":" . $ENV{"TEXINPUTS"};
@@ -1354,6 +1356,7 @@ Content-Length: $numbytes
 
         while (<IN>) {
           print OUT $_;
+
         }
 
         close(OUT);
@@ -1393,6 +1396,7 @@ sub get_formname_translation {
     storno_packing_list     => $main::locale->text('Storno Packing List'),
     sales_delivery_order    => $main::locale->text('Delivery Order'),
     purchase_delivery_order => $main::locale->text('Delivery Order'),
+    dunning                 => $main::locale->text('Dunning'),
   );
 
   $main::lxdebug->leave_sub();