diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/MailReset.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/MailReset.pm index 2e8aa32d4..1606e6a77 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/MailReset.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/MailReset.pm @@ -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; diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm index 783a986c1..04a408847 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm @@ -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; } diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_WebForm.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_WebForm.pm index fd74a3206..2ae1b735f 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_WebForm.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_WebForm.pm @@ -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');