X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDispatcher%2FAuthHandler%2FUser.pm;h=ba5071a1dccb2affa1afc77ad2e2f96b04656519;hb=86eed2325ab7d7342ad0b832931cb8ada6efb5d7;hp=5ee543beb921752805d59d0afc5ccb490ccad6a0;hpb=841d44c00aae1166a0721e40dc2f9ffb7b9ac5b5;p=kivitendo-erp.git diff --git a/SL/Dispatcher/AuthHandler/User.pm b/SL/Dispatcher/AuthHandler/User.pm index 5ee543beb..ba5071a1d 100644 --- a/SL/Dispatcher/AuthHandler/User.pm +++ b/SL/Dispatcher/AuthHandler/User.pm @@ -14,14 +14,14 @@ sub handle { my $client_id = $::form->{'{AUTH}client_id'} || $::auth->get_session_value('client_id'); return $self->_error(%param) if !$client_id || !$::auth->set_client($client_id); - %::myconfig = $::auth->read_user(login => $login); + %::myconfig = User->get_default_myconfig($::auth->read_user(login => $login)); return $self->_error(%param) unless $::myconfig{login}; $::locale = Locale->new($::myconfig{countrycode}); $::request->{layout} = SL::Layout::Dispatcher->new(style => $::myconfig{menustyle}); - my $ok = $::auth->get_api_token_cookie ? 1 : 0; + my $ok = $::auth->is_api_token_cookie_valid; $ok ||= $::form->{'{AUTH}login'} && (SL::Auth::OK() == $::auth->authenticate($::myconfig{login}, $::form->{'{AUTH}password'})); $ok ||= !$::form->{'{AUTH}login'} && (SL::Auth::OK() == $::auth->authenticate($::myconfig{login}, undef)); @@ -29,6 +29,7 @@ sub handle { $::auth->create_or_refresh_session; $::auth->delete_session_value('FLASH'); + $::instance_conf->reload->data; return 1; } @@ -37,7 +38,9 @@ sub _error { my $self = shift; $::auth->punish_wrong_login; - print $::request->{cgi}->redirect('controller.pl?action=LoginScreen/user_login&error=password'); + + require SL::Controller::Base; + SL::Controller::Base->new->redirect_to('controller.pl?action=LoginScreen/user_login&error=password'); return 0; }