X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=SL%2FDispatcher.pm;h=35284db4be23601dc79fb7c46e9a17c7b2c81cae;hb=26353951881b5334436ab599ae3979f6df5d5258;hp=8bd296804c3ea087e6d47728034c0e9593448fd2;hpb=90edf0b1ddcc2aa9ee7cdeb9b46e1ccbea6b0006;p=kivitendo-erp.git diff --git a/SL/Dispatcher.pm b/SL/Dispatcher.pm index 8bd296804..35284db4b 100644 --- a/SL/Dispatcher.pm +++ b/SL/Dispatcher.pm @@ -149,16 +149,16 @@ sub handle_request { pre_request_checks(); eval { + my $session_result = $::auth->restore_session; + $::auth->create_or_refresh_session; + $::form->error($::locale->text('System currently down for maintenance!')) if -e "$::userspath/nologin" && $script ne 'admin'; if ($script eq 'login' or $script eq 'admin' or $script eq 'kopf') { $::form->{titlebar} = "Lx-Office " . $::locale->text('Version') . " $::form->{version}"; - ::run($::auth->restore_session); - - } elsif ($action) { - # copy from am.pl routines - my $session_result = $::auth->restore_session; + ::run($session_result); + } else { show_error('login/password_error', 'session') if SL::Auth::SESSION_EXPIRED == $session_result; %::myconfig = $::auth->read_user($::form->{login}); @@ -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;