X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDispatcher%2FAuthHandler%2FAdmin.pm;h=a7b649cf2bc6d77755063bc792cfa1f1523933d6;hb=1c10936df76a1740bf9c45445b007494495e4c5f;hp=07778b6dbd6523e82aab9105b1c8527da122b40f;hpb=a3339fc75fd7c2fd1328e5444dcde255e4034f95;p=kivitendo-erp.git diff --git a/SL/Dispatcher/AuthHandler/Admin.pm b/SL/Dispatcher/AuthHandler/Admin.pm index 07778b6db..a7b649cf2 100644 --- a/SL/Dispatcher/AuthHandler/Admin.pm +++ b/SL/Dispatcher/AuthHandler/Admin.pm @@ -1,17 +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('login/password_error', 'password', is_admin => 1); + SL::Dispatcher::show_error('admin/adminlogin', 'password'); + + return 0; } 1;