From b32d4e8f524fc0b599a5cdce5029c7c7d40596ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Oudot?= Date: Wed, 23 Jun 2010 14:03:18 +0000 Subject: [PATCH] Remove HttpRedirect and HttpDisableSubmit options in info.tpl, and use hidden fields to store URL parameters, for form GET to work (#115) --- .../lemonldap-ng-portal/example/skins/impact/info.tpl | 9 --------- .../lemonldap-ng-portal/example/skins/pastel/info.tpl | 9 --------- .../lib/Lemonldap/NG/Portal/IssuerDBSAML.pm | 6 +++--- .../lib/Lemonldap/NG/Portal/_SAML.pm | 10 ++-------- 4 files changed, 5 insertions(+), 29 deletions(-) diff --git a/modules/lemonldap-ng-portal/example/skins/impact/info.tpl b/modules/lemonldap-ng-portal/example/skins/impact/info.tpl index 7e0374fb0..3c676dd83 100644 --- a/modules/lemonldap-ng-portal/example/skins/impact/info.tpl +++ b/modules/lemonldap-ng-portal/example/skins/impact/info.tpl @@ -31,18 +31,12 @@ function stop() { _go=0; $('#timer').html("..."); - $('#form button[type=submit]').attr('disabled',''); } function go() { if(_go) { - if(isHiddenFormValueSet('HttpRedirect')){ - url=$("#form").attr('action'); - window.location=url; - }else{ $("#form").submit(); } } - } function timer() { var h=$('#timer').html(); i--; @@ -51,9 +45,6 @@ window.setTimeout('timer()',1000); } $(document).ready(function(){ - if(isHiddenFormValueSet('HideSubmitButton')){ - $('#form button[type=submit]').attr('disabled','disabled'); - } window.setTimeout('go()',10000); window.setTimeout('timer()',1000); }); diff --git a/modules/lemonldap-ng-portal/example/skins/pastel/info.tpl b/modules/lemonldap-ng-portal/example/skins/pastel/info.tpl index 6bf900606..585c94a25 100644 --- a/modules/lemonldap-ng-portal/example/skins/pastel/info.tpl +++ b/modules/lemonldap-ng-portal/example/skins/pastel/info.tpl @@ -29,18 +29,12 @@ function stop() { _go=0; $('#timer').html("..."); - $('#form button[type=submit]').attr('disabled',''); } function go() { if(_go) { - if(isHiddenFormValueSet('HttpRedirect')){ - url=$("#form").attr('action'); - window.location=url; - }else{ $("#form").submit(); } } - } function timer() { var h=$('#timer').html(); i--; @@ -49,9 +43,6 @@ window.setTimeout('timer()',1000); } $(document).ready(function(){ - if(isHiddenFormValueSet('HideSubmitButton')){ - $('#form button[type=submit]').attr('disabled','disabled'); - } window.setTimeout('go()',10000); window.setTimeout('timer()',1000); }); 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 910d88428..cd48a5490 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/IssuerDBSAML.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/IssuerDBSAML.pm @@ -598,7 +598,7 @@ sub issuerForUnAuthUser { # Check if relay parameter is present (mandatory) my $relayID; - unless ( $relayID = $self->param('relay') ) { + unless ( $relayID = $self->getHiddenFormValue('relay') ) { $self->lmLog( "No relayID detected", 'error' ); return PE_ERROR; } @@ -1843,8 +1843,8 @@ sub issuerForAuthUser { else { $self->{urldc} = $self->{portal} - . '/saml/relaySingleLogoutTermination?relay=' - . $relayID; + . '/saml/relaySingleLogoutTermination'; + $self->setHiddenFormValue('relay', $relayID); return PE_INFO; } diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_SAML.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_SAML.pm index c0bdcd84f..754f6e4b9 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_SAML.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_SAML.pm @@ -2493,14 +2493,8 @@ sub sendLogoutRequestToServiceProviders { # End of information block to be displayed to the user. $info .= ''; - # Print some information to the user. The URL to be redirected should - # not be send via a form (because it does not work all time). - if ($providersCount) { - $self->info($info); - $self->setHiddenFormValue( 'HttpRedirect', 'true' ); - - # $self->setHiddenFormValue( 'HideSubmitButton', 'true' ); - } + # Print some information to the user. + $self->info($info) if $providersCount; return $providersCount;