X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDispatcher.pm;h=687c373066113f373a11a4dca6acf03d3fc7d61f;hb=2cbbdcc8d6bd92bc5a05b25b892cfde18c0a6611;hp=da7ffef641b405dbfa2d1f35c7d98f5474027959;hpb=f9c7abfae65b79945beb7e9260942bc94876248a;p=kivitendo-erp.git diff --git a/SL/Dispatcher.pm b/SL/Dispatcher.pm index da7ffef64..687c37306 100644 --- a/SL/Dispatcher.pm +++ b/SL/Dispatcher.pm @@ -9,7 +9,9 @@ BEGIN { } use CGI qw( -no_xhtml); +use Config::Std; use DateTime; +use Encode; use English qw(-no_match_vars); use SL::Auth; use SL::LXDebug; @@ -92,6 +94,9 @@ sub pre_startup_setup { $::form = undef; %::myconfig = (); %::called_subs = (); # currently used for recursion detection + + read_config 'config/lx_office.conf' => %::lx_office_conf if -f "config/lx_office.conf"; + _decode_recursively(\%::lx_office_conf); } $SIG{__WARN__} = sub { @@ -236,7 +241,7 @@ sub handle_request { $::locale = undef; $::form = undef; $::myconfig = (); - Form::disconnect_standard_dbh(); + Form::disconnect_standard_dbh unless $self->_interface_is_fcgi; $::lxdebug->end_request; $::lxdebug->leave_sub; @@ -244,7 +249,7 @@ sub handle_request { sub unrequire_bin_mozilla { my $self = shift; - return unless $self->{interface} =~ m/^(?:fastcgi|fcgid|fcgi)$/; + return unless $self->_interface_is_fcgi; for (keys %INC) { next unless m#^bin/mozilla/#; @@ -254,6 +259,11 @@ sub unrequire_bin_mozilla { } } +sub _interface_is_fcgi { + my $self = shift; + return $self->{interface} =~ m/^(?:fastcgi|fcgid|fcgi)$/; +} + sub _route_request { my $script_name = shift; @@ -315,6 +325,18 @@ sub get_standard_filehandles { return $self->{interface} =~ m/f(?:ast)cgi/i ? $self->{request}->GetHandles() : (\*STDIN, \*STDOUT, \*STDERR); } +sub _decode_recursively { + my ($obj) = @_; + + while (my ($key, $value) = each %{ $obj }) { + if (ref($value) eq 'HASH') { + _decode_recursively($value); + } else { + $obj->{$key} = decode('UTF-8', $value); + } + } +} + package main; use strict;