diff --git a/Makefile b/Makefile
index 44b382670..7cc41feeb 100644
--- a/Makefile
+++ b/Makefile
@@ -317,6 +317,9 @@ install_manager_site: install_conf_dir
install_portal_site: install_conf_dir
# Portal install
+ @mkdir -p $(PORTALDIR)/captcha_output/
+ @mkdir -p $(DATADIR)/captcha/data
+ @chmod -R 777 $(DATADIR)/captcha $(PORTALDIR)/captcha_output/
@install -v -d $(RPORTALDIR) $(RPORTALSKINSDIR) \
$(RPORTALDIR)/skins/ \
$(RCRONDIR) $(RCONFDIR)
diff --git a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Status.pm b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Status.pm
index 012f6db42..fef3c77c0 100644
--- a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Status.pm
+++ b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Status.pm
@@ -93,6 +93,8 @@ sub portalTab {
73 => 'PORTAL_RADIUSCONNECTFAILED',
74 => 'PORTAL_MUST_SUPPLY_OLD_PASSWORD',
75 => 'PORTAL_FORBIDDENIP',
+ 76 => 'PORTAL_CAPTCHAERROR',
+ 77 => 'PORTAL_CAPTCHAEMPTY',
};
}
diff --git a/lemonldap-ng-portal/Makefile.PL b/lemonldap-ng-portal/Makefile.PL
index 0e9fe4716..34264b57e 100644
--- a/lemonldap-ng-portal/Makefile.PL
+++ b/lemonldap-ng-portal/Makefile.PL
@@ -25,7 +25,8 @@ WriteMakefile(
},
PREREQ_PM => {
'Apache::Session' => 0,
- 'CGI' => 3.08,
+ 'Authen::Captcha' => 0,
+ 'CGI' => 3.08,
'File::Basename' => 0,
'HTML::Template' => 0,
'Lemonldap::NG::Common' => '1.2.0',
diff --git a/lemonldap-ng-portal/example/mail.pl b/lemonldap-ng-portal/example/mail.pl
index da291b4ab..538d6b901 100755
--- a/lemonldap-ng-portal/example/mail.pl
+++ b/lemonldap-ng-portal/example/mail.pl
@@ -65,7 +65,16 @@ if (
DISPLAY_MAILSENT => 0,
DISPLAY_PASSWORD_FORM => 0,
);
-}
+
+ # Display captcha if it's enabled
+ if ( $portal->{captcha_enabled} ) {
+ $template->param(
+ CAPTCHA_IMG => $portal->{captcha_img},
+ CAPTCHA_CODE => $portal->{captcha_img},
+ CAPTCHA_SIZE => $portal->{captcha_size}
+ );
+ }
+ }
# Display mail confirmation resent form
if ( $portal->{error} == PE_MAILCONFIRMATION_ALREADY_SENT ) {
diff --git a/lemonldap-ng-portal/example/skins/pastel/mail.tpl b/lemonldap-ng-portal/example/skins/pastel/mail.tpl
index 40b9f20a3..90ee48bbe 100644
--- a/lemonldap-ng-portal/example/skins/pastel/mail.tpl
+++ b/lemonldap-ng-portal/example/skins/pastel/mail.tpl
@@ -20,6 +20,12 @@
|