From 521d171109aa427f970a5acec4fdf08f841251d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-Xavier=20Deltombe?= Date: Wed, 15 Feb 2012 15:28:08 +0000 Subject: [PATCH] IdP choice : replace radio button with submit button (Lemonldap-428) --- .../example/skins/pastel/confirm.tpl | 77 +++++++++++-------- .../lib/Lemonldap/NG/Portal/AuthSAML.pm | 42 ++-------- .../lib/Lemonldap/NG/Portal/Display.pm | 1 + 3 files changed, 53 insertions(+), 67 deletions(-) diff --git a/modules/lemonldap-ng-portal/example/skins/pastel/confirm.tpl b/modules/lemonldap-ng-portal/example/skins/pastel/confirm.tpl index f62b9907f..b88dc95b3 100644 --- a/modules/lemonldap-ng-portal/example/skins/pastel/confirm.tpl +++ b/modules/lemonldap-ng-portal/example/skins/pastel/confirm.tpl @@ -7,6 +7,9 @@
" class="login"> + + + " /> @@ -17,8 +20,48 @@ " /> - + + + +

+ + + + + + + + + +
+ +
+ + + +

+ +
+
- - +
+ diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthSAML.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthSAML.pm index 6afab5fd2..c320cd53e 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthSAML.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthSAML.pm @@ -773,14 +773,6 @@ sub extractFormInfo { # Get confirmation flag my $confirm_flag = $self->param("confirm"); - # If confirmation is -1 from IDP list, - # return error to get next authentication method - # with AuthMulti - if ( $confirm_flag == -1 and $self->param("idplist") ) { - $self->lmLog( "SAML authentication refused by user", 'error' ); - return PE_ERROR; - } - # If confirmation is -1 from resolved IDP screen, # or IDP was not resolve, let the user choose its IDP if ( $confirm_flag == -1 or !$idp ) { @@ -791,36 +783,14 @@ sub extractFormInfo { return $urlcheck unless ( $urlcheck == PE_OK ); # IDP list - my $html = "

" . $self->msg(PM_SAML_IDPSELECT) . "

\n\n"; - + my @list = (); foreach ( keys %{ $self->{_idpList} } ) { - $html .= - ''; + push @list, { + val => $_, + name => $self->{_idpList}->{$_}->{name} + }; } - - $html .= -'
' - . $self->{_idpList}->{$_}->{name} - . '
' - . $self->msg(PM_REMEMBERCHOICE) - . "
\n" - - # URL - . '' - - # IDP list flag - . '' - - # Script to autoselect first choice - . ''; - - $self->info($html); - - # Timer not active on IDP list - $self->{activeTimer} = 0; + $self->{list} = \@list; # Delete existing IDP resolution cookie push @{ $self->{cookie} }, diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Display.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Display.pm index 4a7ad20d0..9145a4283 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Display.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Display.pm @@ -142,6 +142,7 @@ sub display { CHOICE_PARAM => $self->{authChoiceParam}, CHOICE_VALUE => $self->{_authChoice}, CONFIRMKEY => $self->stamp(), + LIST => $self->{list} || [], ); }