]> wagnertech.de Git - mfinanz.git/blobdiff - SL/Controller/LoginScreen.pm
Layouts eingeführt
[mfinanz.git] / SL / Controller / LoginScreen.pm
index aace43a192901305cc77d6122324ce8c9aad4c21..9d0e94bc3bf56a0a450af97eab2679371ea170ce 100644 (file)
@@ -19,7 +19,7 @@ sub action_user_login {
   return if $self->_redirect_to_main_script_if_already_logged_in;
 
   # Otherwise show the login form.
-  $self->render('login_screen/user_login', { no_menu => 1 });
+  $self->render('login_screen/user_login', { no_menu => 1 }, error => error_state($::form->{error}));
 }
 
 sub action_logout {
@@ -38,6 +38,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::Controller::Layout->new(style => $user->{menustyle});
 
   # if we get an error back, bale out
   my $result = $user->login($::form);
@@ -108,4 +109,11 @@ sub _redirect_to_main_script_if_already_logged_in {
   return 1;
 }
 
+sub error_state {
+  return {
+    session  => $::locale->text('The session is invalid or has expired.'),
+    password => $::locale->text('Incorrect password!'),
+  }->{$_[0]};
+}
+
 1;