Merge branch 'master' of vc.linet-services.de:public/lx-office-erp
[kivitendo-erp.git] / SL / Controller / LoginScreen.pm
index c15cf3e..89f21cc 100644 (file)
@@ -7,6 +7,7 @@ use parent qw(SL::Controller::Base);
 use SL::Dispatcher::AuthHandler::User;
 use SL::User;
 
+__PACKAGE__->run_before('set_layout');
 #
 # actions
 #
@@ -38,6 +39,7 @@ sub action_login {
   $::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 +117,8 @@ sub error_state {
   }->{$_[0]};
 }
 
+sub set_layout {
+  $::request->{layout} = SL::Layout::Dispatcher->new(style => 'login');
+}
+
 1;