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 {
return 1;
}
+sub error_state {
+ return {
+ session => $::locale->text('The session is invalid or has expired.'),
+ password => $::locale->text('Incorrect password!'),
+ }->{$_[0]};
+}
+
1;
$::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;
::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,
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;