Revision 32b79fa8
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
SL/Dispatcher/AuthHandler/Admin.pm | ||
---|---|---|
10 | 10 |
|
11 | 11 |
%::myconfig = (); |
12 | 12 |
|
13 |
return 1 if $::auth->get_api_token_cookie;
|
|
14 |
return 1 if $::form->{'{AUTH}admin_password'} && ($::auth->authenticate_root($::form->{'{AUTH}admin_password'}) == $::auth->OK());
|
|
15 |
return 1 if !$::form->{'{AUTH}admin_password'} && ($::auth->authenticate_root($::auth->get_session_value('admin_password')) == $::auth->OK());
|
|
16 |
return 1 if $params{action} eq 'login';
|
|
13 |
my $ok = $::auth->get_api_token_cookie ? 1 : 0;
|
|
14 |
$ok ||= $::form->{'{AUTH}admin_password'} && ($::auth->authenticate_root($::form->{'{AUTH}admin_password'}) == $::auth->OK());
|
|
15 |
$ok ||= !$::form->{'{AUTH}admin_password'} && ($::auth->authenticate_root($::auth->get_session_value('admin_password')) == $::auth->OK());
|
|
16 |
$ok ||= $params{action} eq 'login';
|
|
17 | 17 |
|
18 |
$::request->{layout} = SL::Layout::Dispatcher->new(style => 'admin');
|
|
18 |
$::auth->create_or_refresh_session;
|
|
19 | 19 |
|
20 |
$::auth->punish_wrong_login; |
|
20 |
if ($ok) { |
|
21 |
$::auth->delete_session_value('FLASH'); |
|
22 |
return 1; |
|
23 |
} |
|
24 |
|
|
25 |
$::request->{layout} = SL::Layout::Dispatcher->new(style => 'admin'); |
|
21 | 26 |
$::auth->delete_session_value('admin_password'); |
27 |
$::auth->punish_wrong_login; |
|
22 | 28 |
SL::Dispatcher::show_error('admin/adminlogin', 'password'); |
23 | 29 |
|
24 | 30 |
return 0; |
Auch abrufbar als: Unified diff
Admin-Auth-Handler: FLASH löschen (wie auch beim User)