From 3ab26ffcd0c8bfbf08508624c9ea07fbc6b4352a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Wed, 12 Sep 2012 11:08:23 +0200 Subject: [PATCH] =?utf8?q?Bei=20Loginfehlern=20das=20Men=C3=BC=20nicht=20m?= =?utf8?q?itrendern?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/LoginScreen.pm | 9 ++++++++- SL/Dispatcher.pm | 6 ++++-- SL/Dispatcher/AuthHandler/User.pm | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/SL/Controller/LoginScreen.pm b/SL/Controller/LoginScreen.pm index aace43a19..c15cf3ea8 100644 --- a/SL/Controller/LoginScreen.pm +++ b/SL/Controller/LoginScreen.pm @@ -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 { @@ -108,4 +108,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; diff --git a/SL/Dispatcher.pm b/SL/Dispatcher.pm index 43bf6680b..c67efa79a 100644 --- a/SL/Dispatcher.pm +++ b/SL/Dispatcher.pm @@ -81,7 +81,7 @@ sub show_error { $::form->{error} = $::locale->text('The session is invalid or has expired.') if ($error_type eq 'session'); $::form->{error} = $::locale->text('Incorrect password!') if ($error_type eq 'password'); - $::form->header; + $::form->header(no_menu => 1); print $::form->parse_html_template($template, \%params); $::lxdebug->leave_sub; @@ -225,7 +225,9 @@ sub handle_request { ::run($session_result); } else { - show_error('login_screen/user_login', 'session') if SL::Auth::SESSION_EXPIRED == $session_result; + if (SL::Auth::SESSION_EXPIRED == $session_result) { + print $::request->{cgi}->redirect('controller.pl?action=LoginScreen/user_login&error=session'); + } my %auth_result = $self->{auth_handler}->handle( routing_type => $routing_type, diff --git a/SL/Dispatcher/AuthHandler/User.pm b/SL/Dispatcher/AuthHandler/User.pm index 150245c58..a1b64860a 100644 --- a/SL/Dispatcher/AuthHandler/User.pm +++ b/SL/Dispatcher/AuthHandler/User.pm @@ -31,7 +31,7 @@ sub _error { my $self = shift; $::auth->punish_wrong_login; - SL::Dispatcher::show_error('login_screen/user_login', 'password', @_); + print $::request->{cgi}->redirect('controller.pl?action=LoginScreen/user_login&error=password'); } 1; -- 2.20.1