From: Sven Schöling Date: Wed, 12 Sep 2012 09:08:23 +0000 (+0200) Subject: Bei Loginfehlern das Menü nicht mitrendern X-Git-Tag: release-3.0.0beta1~182 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=3ab26ffc;p=kivitendo-erp.git Bei Loginfehlern das Menü nicht mitrendern --- 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;