Revision 686cba23
Von Moritz Bunkus vor fast 14 Jahren hinzugefügt
SL/Auth.pm | ||
---|---|---|
136 | 136 |
sub authenticate { |
137 | 137 |
$main::lxdebug->enter_sub(); |
138 | 138 |
|
139 |
my $self = shift;
|
|
139 |
my ($self, $login, $password) = @_;
|
|
140 | 140 |
|
141 | 141 |
$main::lxdebug->leave_sub(); |
142 | 142 |
|
143 |
my $result = $self->{authenticator}->authenticate(@_);
|
|
143 |
my $result = $login ? $self->{authenticator}->authenticate($login, $password) : ERR_USER;
|
|
144 | 144 |
return OK if $result eq OK; |
145 | 145 |
sleep 5; |
146 | 146 |
return $result; |
SL/Auth/Constants.pm | ||
---|---|---|
11 | 11 |
ERR => [ qw( |
12 | 12 |
ERR_PASSWORD |
13 | 13 |
ERR_BACKEND |
14 |
ERR_USER |
|
14 | 15 |
) ], |
15 | 16 |
SESSION => [ qw( |
16 | 17 |
SESSION_OK |
... | ... | |
30 | 31 |
|
31 | 32 |
use constant OK => 0; |
32 | 33 |
use constant ERR_PASSWORD => 1; |
34 |
use constant ERR_USER => 2; |
|
33 | 35 |
use constant ERR_BACKEND => 100; |
34 | 36 |
|
35 | 37 |
use constant SESSION_OK => 0; |
bin/mozilla/login.pl | ||
---|---|---|
65 | 65 |
%::myconfig = $auth->read_user($form->{login}) if ($form->{login}); |
66 | 66 |
$::locale = Locale->new($::myconfig{countrycode}) if $::myconfig{countrycode}; |
67 | 67 |
|
68 |
if (!$::myconfig{login} || (SL::Auth::OK != $auth->authenticate($form->{login}, $form->{password}))) {
|
|
68 |
if (SL::Auth::OK != $auth->authenticate($::myconfig{login}, $form->{password})) {
|
|
69 | 69 |
$form->{error_message} = $::locale->text('Incorrect username or password!'); |
70 | 70 |
login_screen(); |
71 | 71 |
} else { |
Auch abrufbar als: Unified diff
Fünf-Sekunden-Verzögerung bei falschem Login auch bei nicht existierendem Benutzernamen erzwingen