Call initCaptcha at the right time (#643)
This commit is contained in:
parent
c31a15660f
commit
fb82ce9522
|
@ -8,7 +8,7 @@ package Lemonldap::NG::Portal::MailReset;
|
|||
use strict;
|
||||
use warnings;
|
||||
|
||||
our $VERSION = '1.3.0';
|
||||
our $VERSION = '1.3.1';
|
||||
|
||||
use Lemonldap::NG::Portal::Simple qw(:all);
|
||||
use base qw(Lemonldap::NG::Portal::SharedConf Exporter);
|
||||
|
@ -88,6 +88,11 @@ sub smtpInit {
|
|||
sub extractMailInfo {
|
||||
my ($self) = splice @_;
|
||||
|
||||
if ( $self->{captcha_mail_enabled} ) {
|
||||
eval { $self->initCaptcha(); };
|
||||
$self->lmLog( "Can't init captcha: $@", "error" ) if $@;
|
||||
}
|
||||
|
||||
unless ( $self->param('mail') || $self->param('mail_token') ) {
|
||||
return PE_MAILFIRSTACCESS if ( $self->request_method =~ /GET/ );
|
||||
return PE_MAILFORMEMPTY;
|
||||
|
|
|
@ -69,7 +69,7 @@ use Digest::MD5;
|
|||
#inherits Apache::Session
|
||||
#link Lemonldap::NG::Common::Apache::Session::SOAP protected globalStorage
|
||||
|
||||
our $VERSION = '1.3.0';
|
||||
our $VERSION = '1.3.1';
|
||||
|
||||
use base qw(Lemonldap::NG::Common::CGI Exporter);
|
||||
our @ISA;
|
||||
|
@ -471,12 +471,6 @@ sub new {
|
|||
$self->{trustedDomains} =~ s/\./\\./g;
|
||||
}
|
||||
|
||||
# Init the captcha feature if it's enabled
|
||||
if ( $self->{captcha_login_enabled} || $self->{captcha_mail_enabled} ) {
|
||||
eval { $self->initCaptcha(); };
|
||||
$self->lmLog( "Can't init captcha: $@", "error" ) if $@;
|
||||
}
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ package Lemonldap::NG::Portal::_WebForm;
|
|||
use Lemonldap::NG::Portal::Simple qw(:all);
|
||||
use strict;
|
||||
|
||||
our $VERSION = '1.3.0';
|
||||
our $VERSION = '1.3.1';
|
||||
|
||||
## @apmethod int authInit()
|
||||
# Does nothing.
|
||||
|
@ -23,6 +23,12 @@ sub authInit {
|
|||
sub extractFormInfo {
|
||||
my $self = shift;
|
||||
|
||||
# Init captcha
|
||||
if ( $self->{captcha_login_enabled} ) {
|
||||
eval { $self->initCaptcha(); };
|
||||
$self->lmLog( "Can't init captcha: $@", "error" ) if $@;
|
||||
}
|
||||
|
||||
# Detect first access and empty forms
|
||||
my $defUser = defined $self->param('user');
|
||||
my $defPassword = defined $self->param('password');
|
||||
|
|
Loading…
Reference in New Issue
Block a user