diff --git a/modules/lemonldap-ng-portal/example/index_skin.pl b/modules/lemonldap-ng-portal/example/index_skin.pl index 5cc37a2b4..600a313bd 100755 --- a/modules/lemonldap-ng-portal/example/index_skin.pl +++ b/modules/lemonldap-ng-portal/example/index_skin.pl @@ -108,6 +108,7 @@ elsif ( my $notif = $portal->notification ) { AUTH_ERROR_TYPE => $portal->error_type, NOTIFICATION => $notif, SKIN => $skin, + HIDDEN_INPUTS => $portal->buildHiddenForm(), ); } @@ -121,6 +122,7 @@ elsif ( $portal->{error} == PE_CONFIRM ) { AUTH_URL => $portal->get_url, MSG => $portal->info(), SKIN => $skin, + HIDDEN_INPUTS => $portal->buildHiddenForm(), ); } @@ -137,6 +139,7 @@ else { DISPLAY_RESETPASSWORD => $portal->{portalDisplayResetPassword}, DISPLAY_FORM => 1, MAIL_URL => $portal->{mailUrl}, + HIDDEN_INPUTS => $portal->buildHiddenForm(), ); # Adapt template if password policy error diff --git a/modules/lemonldap-ng-portal/example/skins/impact/confirm.tpl b/modules/lemonldap-ng-portal/example/skins/impact/confirm.tpl index c0a5b099f..a28a18f32 100644 --- a/modules/lemonldap-ng-portal/example/skins/impact/confirm.tpl +++ b/modules/lemonldap-ng-portal/example/skins/impact/confirm.tpl @@ -9,6 +9,7 @@

" method="get" class="login"> + " />
diff --git a/modules/lemonldap-ng-portal/example/skins/impact/login.tpl b/modules/lemonldap-ng-portal/example/skins/impact/login.tpl index e88a5d50e..34389aa61 100644 --- a/modules/lemonldap-ng-portal/example/skins/impact/login.tpl +++ b/modules/lemonldap-ng-portal/example/skins/impact/login.tpl @@ -17,6 +17,7 @@

+

diff --git a/modules/lemonldap-ng-portal/example/skins/impact/notification.tpl b/modules/lemonldap-ng-portal/example/skins/impact/notification.tpl index 5ab7876ac..22752d3f4 100644 --- a/modules/lemonldap-ng-portal/example/skins/impact/notification.tpl +++ b/modules/lemonldap-ng-portal/example/skins/impact/notification.tpl @@ -9,6 +9,7 @@


+
diff --git a/modules/lemonldap-ng-portal/example/skins/pastel/confirm.tpl b/modules/lemonldap-ng-portal/example/skins/pastel/confirm.tpl index b9a080b84..7d30197cf 100644 --- a/modules/lemonldap-ng-portal/example/skins/pastel/confirm.tpl +++ b/modules/lemonldap-ng-portal/example/skins/pastel/confirm.tpl @@ -7,6 +7,7 @@ " method="post" class="login"> +

" />

diff --git a/modules/lemonldap-ng-portal/example/skins/pastel/login.tpl b/modules/lemonldap-ng-portal/example/skins/pastel/login.tpl index dff1a1088..864adf6eb 100644 --- a/modules/lemonldap-ng-portal/example/skins/pastel/login.tpl +++ b/modules/lemonldap-ng-portal/example/skins/pastel/login.tpl @@ -9,6 +9,8 @@

+ +

" />

diff --git a/modules/lemonldap-ng-portal/example/skins/pastel/notification.tpl b/modules/lemonldap-ng-portal/example/skins/pastel/notification.tpl index 2e258ff90..6ac7f5c89 100644 --- a/modules/lemonldap-ng-portal/example/skins/pastel/notification.tpl +++ b/modules/lemonldap-ng-portal/example/skins/pastel/notification.tpl @@ -7,6 +7,7 @@ +

 :

diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/IssuerDBSAML.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/IssuerDBSAML.pm index bb2304988..6e211975f 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/IssuerDBSAML.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/IssuerDBSAML.pm @@ -95,11 +95,13 @@ sub issuerForUnAuthUser { my $isPassive = $saml_request->IsPassive(); if ($isPassive) { - $self->lmLog( "Found isPassive flag in assertion conditions", - 'debug' ); + $self->lmLog( "Found isPassive flag in SAML request", 'debug' ); return PE_ERROR; } + # Save dump into SAMLRequest hidden field + $self->setHiddenFormValue( 'SAMLRequest', $saml_request->dump() ); + } } diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm index c7031416d..503f18a26 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm @@ -320,6 +320,7 @@ sub setDefaultValues { $self->{portalForceAuthnInterval} = 5 unless ( defined( $self->{portalForceAuthnInterval} ) ); $self->{portalUserAttr} ||= "_user"; + $self->{portalHiddenFormValues} = (); $self->{securedCookie} ||= 0; $self->{cookieName} ||= "lemonldap"; $self->{authentication} ||= 'LDAP'; @@ -365,6 +366,52 @@ sub setDefaultValues { $self->{samlIdPResolveCookie} ||= "lemonldapidp"; } +##@method protected void setHiddenFormValue(string fieldname, string value) +# Add element into $self->{portalHiddenFormValues}, those values could be +# used to hide values into HTML form. +#@param $fieldname The field name which will contain the correponding value +#@param $value The associated value +sub setHiddenFormValue { + my $self = shift; + my $key = shift; + my $val = shift; + $self->{portalHiddenFormValues}->{$key} = $val; +} + +##@method public array getHiddenFormFields() +# Return all hidden field names. +#@return array All hidden field names +sub getHiddenFormFields { + my $self = shift; + return keys %{$self->{portalHiddenFormValues}}; +} + +##@method public void getHiddenFormValue(string fieldname) +# Get value into $self->{portalHiddenFormValues}. +#@param $fieldname The existing field name which contains a value +#@return string The associated value +sub getHiddenFormValue { + my $self = shift; + my $key = shift; + return '' unless ( defined($self->{portalHiddenFormValues}->{$key}) ); + return $self->{portalHiddenFormValues}->{$key} +} + +##@method public string buildHiddenForm() +# Return an HTML representation of hidden values. +#@return string +sub buildHiddenForm { + my $self = shift; + my @keys = $self->getHiddenFormFields(); + my $val = ''; + foreach ( @keys ) + { + $val .= ''; + } + return $val; +} + =begin WSDL _IN lang $string Language