X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDispatcher.pm;h=31c76a5a4493596c4644686b405311fcafb2f4ed;hb=75f7cc1dab30b70f9f1044a1ef3d8a924bf35c34;hp=16337b24e187dab21b875cb1017aba2f30979826;hpb=a21cec5283b01032d217d88745186080f49c9f16;p=kivitendo-erp.git diff --git a/SL/Dispatcher.pm b/SL/Dispatcher.pm index 16337b24e..31c76a5a4 100644 --- a/SL/Dispatcher.pm +++ b/SL/Dispatcher.pm @@ -19,7 +19,6 @@ use IO::File; use List::MoreUtils qw(all); use List::Util qw(first); use POSIX qw(setlocale); -use SL::ArchiveZipFixes; use SL::Auth; use SL::Dispatcher::AuthHandler; use SL::LXDebug; @@ -51,8 +50,6 @@ sub new { $self->{interface} = lc($interface || 'cgi'); $self->{auth_handler} = SL::Dispatcher::AuthHandler->new; - SL::ArchiveZipFixes->apply_fixes; - # Initialize character type locale to be UTF-8 instead of C: foreach my $locale (qw(de_DE.UTF-8 en_US.UTF-8)) { last if setlocale('LC_CTYPE', $locale); @@ -250,7 +247,7 @@ sub handle_request { my $session_result = $self->pre_request_initialization; - $::form->read_cgi_input; + $::request->read_cgi_input($::form); my %routing; eval { %routing = $self->_route_request($ENV{SCRIPT_NAME}); 1; } or return; @@ -402,6 +399,7 @@ sub handle_login_error { if ( $action =~ m/LoginScreen\/user_login/ && $params{action} && 'get' eq lc($ENV{REQUEST_METHOD}) + && !_is_callback_blacklisted(map {$_ => $params{$_}} qw(routing_type script controller action) ) ) { require SL::Controller::Base; @@ -419,6 +417,48 @@ sub handle_login_error { $self->end_request; } +sub _is_callback_blacklisted { + my (%params) = @_; + + # You can give a name only, then all actions are blackisted. + # Or you can give name and action, then only this action is blacklisted + # examples: + # {name => 'is', action => 'edit'} + # {name => 'Project', action => 'edit'}, + my @script_blacklist = ( + {name => 'admin'}, + {name => 'login'}, + ); + + my @controller_blacklist = ( + {name => 'Admin'}, + {name => 'LoginScreen'}, + ); + + my ($name, $blacklist); + if ('old' eq ($params{routing_type} // '')) { + $name = $params{script}; + $blacklist = \@script_blacklist; + } else { + $name = $params{controller}; + $blacklist = \@controller_blacklist; + } + + foreach my $bl (@$blacklist) { + return 1 if _is_name_action_blacklisted($bl->{name}, $bl->{action}, $name, $params{action}); + } + + return; +} + +sub _is_name_action_blacklisted { + my ($blacklisted_name, $blacklisted_action, $name, $action) = @_; + + return 1 if ($name // '') eq $blacklisted_name && !$blacklisted_action; + return 1 if ($name // '') eq $blacklisted_name && ($action // '') eq $blacklisted_action; + return; +} + sub unrequire_bin_mozilla { my $self = shift; return unless $self->_interface_is_fcgi;