Load bruteForce plugin only if history is gt attempts

This commit is contained in:
Christophe Maudoux 2020-01-13 14:10:14 +01:00
parent 0dd6b28616
commit c47466698d

View File

@ -4,7 +4,7 @@ use strict;
use Mouse;
use Lemonldap::NG::Portal::Main::Constants qw(PE_OK PE_WAIT);
our $VERSION = '2.0.6';
our $VERSION = '2.0.8';
extends 'Lemonldap::NG::Portal::Main::Plugin';
@ -19,6 +19,16 @@ sub init {
'"History" plugin is required for "BruteForceProtection" plugin');
return 0;
}
unless ( $self->conf->{failedLoginNumber} >
$self->conf->{bruteForceProtectionMaxFailed} )
{
$self->logger->error( 'failedLoginNumber('
. $self->conf->{failedLoginNumber}
. ') must be higher than bruteForceProtectionMaxFailed('
. $self->conf->{bruteForceProtectionMaxFailed}
. ')' );
return 0;
}
return 1;
}