X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FLoginScreen.pm;h=81ad8dd5c8143098f85ddef6839e5a7d2788ae8b;hb=a4f1494fd428b5388c92a0ad065ad807f32c2090;hp=c15cf3ea8f9d4b8c3e1a0d9d8e7c848cc4aaef0a;hpb=3ab26ffcd0c8bfbf08508624c9ea07fbc6b4352a;p=kivitendo-erp.git diff --git a/SL/Controller/LoginScreen.pm b/SL/Controller/LoginScreen.pm index c15cf3ea8..81ad8dd5c 100644 --- a/SL/Controller/LoginScreen.pm +++ b/SL/Controller/LoginScreen.pm @@ -7,6 +7,7 @@ use parent qw(SL::Controller::Base); use SL::Dispatcher::AuthHandler::User; use SL::User; +__PACKAGE__->run_before('set_layout'); # # actions # @@ -33,11 +34,13 @@ sub action_logout { sub action_login { my ($self) = @_; - %::myconfig = $::form->{'{AUTH}login'} ? $::auth->read_user(login => $::form->{'{AUTH}login'}) : (); - %::myconfig = SL::Dispatcher::AuthHandler::User->new->handle(countrycode => $::myconfig{countrycode}); + my $login = $::form->{'{AUTH}login'} || $::auth->get_session_value('login'); + %::myconfig = $login ? $::auth->read_user(login => $login) : (); + SL::Dispatcher::AuthHandler::User->new->handle(countrycode => $::myconfig{countrycode}); $::form->{login} = $::myconfig{login}; $::locale = Locale->new($::myconfig{countrycode}) if $::myconfig{countrycode}; my $user = User->new(login => $::myconfig{login}); + $::request->{layout} = SL::Layout::Dispatcher->new(style => $user->{menustyle}); # if we get an error back, bale out my $result = $user->login($::form); @@ -115,4 +118,8 @@ sub error_state { }->{$_[0]}; } +sub set_layout { + $::request->{layout} = SL::Layout::Dispatcher->new(style => 'login'); +} + 1;