diff --git a/modules/lemonldap-ng-portal/example/mail.pl b/modules/lemonldap-ng-portal/example/mail.pl index c28c2673c..957f88960 100755 --- a/modules/lemonldap-ng-portal/example/mail.pl +++ b/modules/lemonldap-ng-portal/example/mail.pl @@ -26,6 +26,8 @@ $template->param( PORTAL_URL => "$portal_url" ); $template->param( SKIN => "$skin" ); $template->param( AUTH_ERROR => $portal->error ); $template->param( AUTH_ERROR_TYPE => $portal->error_type ); +$template->param( CHOICE_PARAM => $portal->{authChoiceParam} ); +$template->param( CHOICE_VALUE => $portal->{_authChoice} ); # Display form the first time $template->param( DISPLAY_FORM => 1 ) diff --git a/modules/lemonldap-ng-portal/example/skins/impact/mail.tpl b/modules/lemonldap-ng-portal/example/skins/impact/mail.tpl index f5adc3959..1893a11aa 100644 --- a/modules/lemonldap-ng-portal/example/skins/impact/mail.tpl +++ b/modules/lemonldap-ng-portal/example/skins/impact/mail.tpl @@ -10,6 +10,7 @@

+ " value="" />
diff --git a/modules/lemonldap-ng-portal/example/skins/impact/standardform.tpl b/modules/lemonldap-ng-portal/example/skins/impact/standardform.tpl index 237865bab..e39b97473 100644 --- a/modules/lemonldap-ng-portal/example/skins/impact/standardform.tpl +++ b/modules/lemonldap-ng-portal/example/skins/impact/standardform.tpl @@ -19,7 +19,7 @@

- /images/arrow.png" />"> + /images/arrow.png" />?=">

diff --git a/modules/lemonldap-ng-portal/example/skins/pastel/mail.tpl b/modules/lemonldap-ng-portal/example/skins/pastel/mail.tpl index 948f181ac..a99c7911d 100644 --- a/modules/lemonldap-ng-portal/example/skins/pastel/mail.tpl +++ b/modules/lemonldap-ng-portal/example/skins/pastel/mail.tpl @@ -10,6 +10,8 @@ + " value="" /> +

diff --git a/modules/lemonldap-ng-portal/example/skins/pastel/standardform.tpl b/modules/lemonldap-ng-portal/example/skins/pastel/standardform.tpl index 8eaa5c961..9b55d4257 100644 --- a/modules/lemonldap-ng-portal/example/skins/pastel/standardform.tpl +++ b/modules/lemonldap-ng-portal/example/skins/pastel/standardform.tpl @@ -21,10 +21,10 @@
- +
diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthChoice.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthChoice.pm index d54411f05..cb3d2f5f6 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthChoice.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthChoice.pm @@ -11,7 +11,7 @@ use Lemonldap::NG::Portal::Simple; #inherits Lemonldap::NG::Portal::_Choice -our $VERSION = '1.0.0'; +our $VERSION = '1.0.2'; ## @apmethod int authInit() # Build authentication loop @@ -23,20 +23,6 @@ sub authInit { # Build authLoop $self->{authLoop} = $self->_buildAuthLoop(); - # Get authentication choice - $self->{_authChoice} = $self->param( $self->{authChoiceParam} ); - - # Check XSS Attack - $self->{_authChoice} = "" - if ( $self->{_authChoice} - and - $self->checkXSSAttack( $self->{authChoiceParam}, $self->{_authChoice} ) - ); - - $self->lmLog( "Authentication choice found: " . $self->{_authChoice}, - 'debug' ) - if $self->{_authChoice}; - return $self->_choice->try( 'authInit', 0 ); } diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/MailReset.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/MailReset.pm index 91685dd5e..3436959ee 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/MailReset.pm +++ b/modules/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.0.0'; +our $VERSION = '1.0.2'; use Lemonldap::NG::Portal::Simple qw(:all); use base qw(Lemonldap::NG::Portal::SharedConf Exporter); @@ -152,6 +152,8 @@ sub sendConfirmationMail { # Build confirmation url my $url = $self->{mailUrl} . "?mail_token=" . $self->{id}; + $url .= '&' . $self->{authChoiceParam} . '=' . $self->{_authChoice} + if ( $self->{_authChoice} ); # Build mail content my $subject = $self->{mailConfirmSubject}; diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_Choice.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_Choice.pm index e2de90016..801a26966 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_Choice.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_Choice.pm @@ -8,7 +8,7 @@ package Lemonldap::NG::Portal::_Choice; use Lemonldap::NG::Portal::Simple; -our $VERSION = '1.0.0'; +our $VERSION = '1.0.2'; ## @cmethod Lemonldap::NG::Portal::_Choice new(Lemonldap::NG::Portal::Simple portal) # Constructor @@ -131,7 +131,24 @@ package Lemonldap::NG::Portal::Simple; # @return Lemonldap::NG::Portal::_Choice object sub _choice { my $self = shift; + + # Check if choice is already built return $self->{_choice} if ( $self->{_choice} ); + + # Get authentication choice + $self->{_authChoice} = $self->param( $self->{authChoiceParam} ); + + # Check XSS Attack + $self->{_authChoice} = "" + if ( $self->{_authChoice} + and + $self->checkXSSAttack( $self->{authChoiceParam}, $self->{_authChoice} ) + ); + + $self->lmLog( "Authentication choice found: " . $self->{_authChoice}, + 'debug' ) + if $self->{_authChoice}; + return $self->{_choice} = Lemonldap::NG::Portal::_Choice->new($self); }