1 package SL::Dispatcher::AuthHandler::User;
5 use parent qw(Rose::Object);
8 my ($self, %param) = @_;
10 my $login = $::form->{'{AUTH}login'} || $::auth->get_session_value('login');
11 $self->_error(%param) if !defined $login;
13 %::myconfig = $::auth->read_user(login => $login);
15 $self->_error(%param) unless $::myconfig{login};
17 $::locale = Locale->new($::myconfig{countrycode});
19 my $ok = $::form->{'{AUTH}login'} && (SL::Auth::OK() == $::auth->authenticate($::myconfig{login}, $::form->{'{AUTH}password'}));
20 $ok ||= !$::form->{'{AUTH}login'} && (SL::Auth::OK() == $::auth->authenticate($::myconfig{login}, undef));
22 $self->_error(%param) if !$ok;
24 $::auth->create_or_refresh_session;
25 $::auth->delete_session_value('FLASH');
33 $::auth->punish_wrong_login;
34 SL::Dispatcher::show_error('login_screen/user_login', 'password', @_);