Revision a3339fc7
Von Moritz Bunkus vor etwa 12 Jahren hinzugefügt
SL/Dispatcher/AuthHandler/User.pm | ||
---|---|---|
5 | 5 |
use parent qw(Rose::Object); |
6 | 6 |
|
7 | 7 |
sub handle { |
8 |
my $login = $::auth->get_session_value('login'); |
|
8 |
my $login = $::form->{'{AUTH}login'} || $::auth->get_session_value('login');
|
|
9 | 9 |
SL::Dispatcher::show_error('login/password_error', 'password') if not defined $login; |
10 | 10 |
|
11 | 11 |
%::myconfig = $::auth->read_user(login => $login); |
... | ... | |
14 | 14 |
|
15 | 15 |
$::locale = Locale->new($::myconfig{countrycode}); |
16 | 16 |
|
17 |
SL::Dispatcher::show_error('login/password_error', 'password') if SL::Auth::OK != $::auth->authenticate($login, undef); |
|
17 |
my $ok = $::form->{'{AUTH}login'} && (SL::Auth::OK == $::auth->authenticate($login, $::form->{'{AUTH}password'})); |
|
18 |
$ok ||= !$::form->{'{AUTH}login'} && (SL::Auth::OK == $::auth->authenticate($login, undef)); |
|
19 |
|
|
20 |
SL::Dispatcher::show_error('login/password_error', 'password') if !$ok; |
|
18 | 21 |
|
19 | 22 |
$::auth->create_or_refresh_session; |
20 | 23 |
$::auth->delete_session_value('FLASH'); |
21 |
delete $::form->{password}; |
|
22 | 24 |
} |
23 | 25 |
|
24 | 26 |
1; |
Auch abrufbar als: Unified diff
User- und Adminlogin jederzeit via Formularfelder ermöglichen