sub authenticate {
$main::lxdebug->enter_sub();
- my $self = shift;
+ my ($self, $login, $password) = @_;
$main::lxdebug->leave_sub();
- my $result = $self->{authenticator}->authenticate(@_);
+ my $result = $login ? $self->{authenticator}->authenticate($login, $password) : ERR_USER;
return OK if $result eq OK;
sleep 5;
return $result;
ERR => [ qw(
ERR_PASSWORD
ERR_BACKEND
+ ERR_USER
) ],
SESSION => [ qw(
SESSION_OK
use constant OK => 0;
use constant ERR_PASSWORD => 1;
+use constant ERR_USER => 2;
use constant ERR_BACKEND => 100;
use constant SESSION_OK => 0;
%::myconfig = $auth->read_user($form->{login}) if ($form->{login});
$::locale = Locale->new($::myconfig{countrycode}) if $::myconfig{countrycode};
- if (!$::myconfig{login} || (SL::Auth::OK != $auth->authenticate($form->{login}, $form->{password}))) {
+ if (SL::Auth::OK != $auth->authenticate($::myconfig{login}, $form->{password})) {
$form->{error_message} = $::locale->text('Incorrect username or password!');
login_screen();
} else {