Revision 0e451e1b
Von Moritz Bunkus vor fast 12 Jahren hinzugefügt
SL/Dispatcher/AuthHandler/User.pm | ||
---|---|---|
9 | 9 |
my ($self, %param) = @_; |
10 | 10 |
|
11 | 11 |
my $login = $::form->{'{AUTH}login'} || $::auth->get_session_value('login'); |
12 |
$self->_error(%param) if !defined $login; |
|
12 |
return $self->_error(%param) if !defined $login;
|
|
13 | 13 |
|
14 | 14 |
%::myconfig = $::auth->read_user(login => $login); |
15 | 15 |
|
16 |
$self->_error(%param) unless $::myconfig{login}; |
|
16 |
return $self->_error(%param) unless $::myconfig{login};
|
|
17 | 17 |
|
18 | 18 |
$::locale = Locale->new($::myconfig{countrycode}); |
19 | 19 |
$::request->{layout} = SL::Layout::Dispatcher->new(style => $::myconfig{menustyle}); |
... | ... | |
21 | 21 |
my $ok = $::form->{'{AUTH}login'} && (SL::Auth::OK() == $::auth->authenticate($::myconfig{login}, $::form->{'{AUTH}password'})); |
22 | 22 |
$ok ||= !$::form->{'{AUTH}login'} && (SL::Auth::OK() == $::auth->authenticate($::myconfig{login}, undef)); |
23 | 23 |
|
24 |
$self->_error(%param) if !$ok; |
|
24 |
return $self->_error(%param) if !$ok;
|
|
25 | 25 |
|
26 | 26 |
$::auth->create_or_refresh_session; |
27 | 27 |
$::auth->delete_session_value('FLASH'); |
28 | 28 |
|
29 |
return %::myconfig;
|
|
29 |
return 1;
|
|
30 | 30 |
} |
31 | 31 |
|
32 | 32 |
sub _error { |
... | ... | |
34 | 34 |
|
35 | 35 |
$::auth->punish_wrong_login; |
36 | 36 |
print $::request->{cgi}->redirect('controller.pl?action=LoginScreen/user_login&error=password'); |
37 |
return 0; |
|
37 | 38 |
} |
38 | 39 |
|
39 | 40 |
1; |
Auch abrufbar als: Unified diff
Nach fehlgeschlagenem AuthHandler Request nicht fortsetzen
Ansonsten wird zwar der '302'-Redirect ausgegeben, der Controller aber
trotzdem ausgeführt.