X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDispatcher.pm;h=98c93d4f4092ed68eb3493f9fc471bff1fa88830;hb=38aac441bd2735f2af58e82f009e8369cf8afb0c;hp=e5a7daab89f8fc2520a1bac3dfff637ed8fba0e6;hpb=193b1e4e590fd0eb49606dea36130c72e70eee05;p=kivitendo-erp.git diff --git a/SL/Dispatcher.pm b/SL/Dispatcher.pm index e5a7daab8..98c93d4f4 100644 --- a/SL/Dispatcher.pm +++ b/SL/Dispatcher.pm @@ -82,6 +82,10 @@ sub pre_startup_setup { %::myconfig = (); %::called_subs = (); # currently used for recursion detection } + + $SIG{__WARN__} = sub { + $::lxdebug->warn(@_); + } } sub pre_startup_checks { @@ -126,13 +130,9 @@ sub handle_request { my $interface = lc(shift || 'cgi'); my ($script_name, $action); - if ($interface =~ m/^(?:fastcgi|fcgid|fcgi)$/) { - $script_name = $ENV{SCRIPT_NAME}; - unrequire_bin_mozilla(); + $script_name = $ENV{SCRIPT_NAME}; - } else { - $script_name = $0; - } + unrequire_bin_mozilla($interface); $::cgi = CGI->new(''); $::locale = Locale->new($::language); @@ -155,7 +155,7 @@ sub handle_request { $::form->{titlebar} = "Lx-Office " . $::locale->text('Version') . " $::form->{version}"; ::run($::auth->restore_session); - } elsif ($action) { + } else { # copy from am.pl routines my $session_result = $::auth->restore_session; @@ -172,14 +172,15 @@ sub handle_request { $::auth->create_or_refresh_session; delete $::form->{password}; - map { $::form->{$_} = $::myconfig{$_} } qw(stylesheet charset) - unless $action eq 'save' && $::form->{type} eq 'preferences'; + if ($action) { + map { $::form->{$_} = $::myconfig{$_} } qw(stylesheet charset) + unless $action eq 'save' && $::form->{type} eq 'preferences'; - $::form->set_standard_title; - ::call_sub('::' . $::locale->findsub($action)); - - } else { - $::form->error($::locale->text('action= not defined!')); + $::form->set_standard_title; + ::call_sub('::' . $::locale->findsub($action)); + } else { + $::form->error($::locale->text('action= not defined!')); + } } 1; @@ -201,6 +202,8 @@ sub handle_request { } sub unrequire_bin_mozilla { + return unless $_[0] =~ m/^(?:fastcgi|fcgid|fcgi)$/; + for (keys %INC) { next unless m#^bin/mozilla/#; next if /\bcommon.pl$/;