X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/469ca9fc3cac624073270fc3217766dbb7aba253..6f266e929ff3eaefc84c34b46fa452c50eecbcf4:/SL/Dispatcher/AuthHandler/Admin.pm diff --git a/SL/Dispatcher/AuthHandler/Admin.pm b/SL/Dispatcher/AuthHandler/Admin.pm index 77202e8e4..a7b649cf2 100644 --- a/SL/Dispatcher/AuthHandler/Admin.pm +++ b/SL/Dispatcher/AuthHandler/Admin.pm @@ -1,18 +1,24 @@ package SL::Dispatcher::AuthHandler::Admin; use strict; - use parent qw(Rose::Object); +use SL::Layout::Dispatcher; + sub handle { %::myconfig = (); - return if $::form->{'{AUTH}admin_password'} && ($::auth->authenticate_root($::form->{'{AUTH}admin_password'}) == $::auth->OK()); - return if !$::form->{'{AUTH}admin_password'} && ($::auth->authenticate_root($::auth->get_session_value('admin_password')) == $::auth->OK()); + return 1 if $::auth->get_api_token_cookie; + return 1 if $::form->{'{AUTH}admin_password'} && ($::auth->authenticate_root($::form->{'{AUTH}admin_password'}) == $::auth->OK()); + return 1 if !$::form->{'{AUTH}admin_password'} && ($::auth->authenticate_root($::auth->get_session_value('admin_password')) == $::auth->OK()); + + $::request->{layout} = SL::Layout::Dispatcher->new(style => 'admin'); $::auth->punish_wrong_login; $::auth->delete_session_value('admin_password'); SL::Dispatcher::show_error('admin/adminlogin', 'password'); + + return 0; } 1;