From a85404a430588940764a01c71779fe8fdfe42db0 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 17 Jun 2013 17:20:09 +0200 Subject: [PATCH] =?utf8?q?Codevereinfachung:=20Shortcut=20&=20dadurch=20we?= =?utf8?q?niger=20Einr=C3=BCckung?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Dispatcher.pm | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/SL/Dispatcher.pm b/SL/Dispatcher.pm index 1d8b6e5d5..f4c21d065 100644 --- a/SL/Dispatcher.pm +++ b/SL/Dispatcher.pm @@ -248,38 +248,38 @@ sub handle_request { _require_controller('LoginScreen'); } - if ((($script eq 'login') && !$action) || ($script eq 'admin')) { + if ( (($script eq 'login') && !$action) + || ($script eq 'admin') + || (SL::Auth::SESSION_EXPIRED() == $session_result)) { $self->redirect_to_login($script); - } else { - $self->redirect_to_login($script) if SL::Auth::SESSION_EXPIRED == $session_result; + } - my %auth_result = $self->{auth_handler}->handle( - routing_type => $routing_type, - script => $script, - controller => $script_name, - action => $action, - ); + my %auth_result = $self->{auth_handler}->handle( + routing_type => $routing_type, + script => $script, + controller => $script_name, + action => $action, + ); - ::end_of_request() unless $auth_result{auth_ok}; + ::end_of_request() unless $auth_result{auth_ok}; - delete @{ $::form }{ grep { m/^\{AUTH\}/ } keys %{ $::form } } unless $auth_result{keep_auth_vars}; + delete @{ $::form }{ grep { m/^\{AUTH\}/ } keys %{ $::form } } unless $auth_result{keep_auth_vars}; - if ($action) { - $::instance_conf->init if $auth_result{auth_level} eq 'user'; + if ($action) { + $::instance_conf->init if $auth_result{auth_level} eq 'user'; - map { $::form->{$_} = $::myconfig{$_} } qw(charset) - unless $action eq 'save' && $::form->{type} eq 'preferences'; + map { $::form->{$_} = $::myconfig{$_} } qw(charset) + unless $action eq 'save' && $::form->{type} eq 'preferences'; - $::form->set_standard_title; - if ($routing_type eq 'old') { - ::call_sub('::' . $::locale->findsub($action)); - } else { - _run_controller($script_name, $action); - } + $::form->set_standard_title; + if ($routing_type eq 'old') { + ::call_sub('::' . $::locale->findsub($action)); } else { - $::form->error($::locale->text('action= not defined!')); + _run_controller($script_name, $action); } + } else { + $::form->error($::locale->text('action= not defined!')); } 1; -- 2.20.1