From e29a65e92b2d6e369bf8d5d6485d37da691a1504 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Oudot?= Date: Wed, 18 Aug 2010 15:10:30 +0000 Subject: [PATCH] Disable timer on IDP list (#141) --- modules/lemonldap-ng-portal/example/index_skin.pl | 3 +++ .../lemonldap-ng-portal/example/skins/impact/confirm.tpl | 8 ++++++++ modules/lemonldap-ng-portal/example/skins/impact/info.tpl | 8 ++++++++ .../lemonldap-ng-portal/example/skins/pastel/confirm.tpl | 8 ++++++++ modules/lemonldap-ng-portal/example/skins/pastel/info.tpl | 8 ++++++++ .../lib/Lemonldap/NG/Portal/AuthSAML.pm | 5 ++++- .../lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm | 1 + 7 files changed, 40 insertions(+), 1 deletion(-) diff --git a/modules/lemonldap-ng-portal/example/index_skin.pl b/modules/lemonldap-ng-portal/example/index_skin.pl index cde652b86..fce9e0b4a 100755 --- a/modules/lemonldap-ng-portal/example/index_skin.pl +++ b/modules/lemonldap-ng-portal/example/index_skin.pl @@ -68,6 +68,7 @@ if ( $portal->process() ) { SKIN => $skin, URL => $portal->{urldc}, HIDDEN_INPUTS => $portal->buildHiddenForm(), + ACTIVE_TIMER => $portal->{activeTimer}, ); } @@ -136,6 +137,7 @@ elsif ( $portal->{error} == PE_CONFIRM ) { MSG => $portal->info(), SKIN => $skin, HIDDEN_INPUTS => $portal->buildHiddenForm(), + ACTIVE_TIMER => $portal->{activeTimer}, ); } @@ -149,6 +151,7 @@ elsif ( my $info = $portal->info() ) { SKIN => $skin, URL => $portal->{urldc}, HIDDEN_INPUTS => $portal->buildHiddenForm(), + ACTIVE_TIMER => $portal->{activeTimer}, ); } diff --git a/modules/lemonldap-ng-portal/example/skins/impact/confirm.tpl b/modules/lemonldap-ng-portal/example/skins/impact/confirm.tpl index 9d73cb92e..8f62db7f9 100644 --- a/modules/lemonldap-ng-portal/example/skins/impact/confirm.tpl +++ b/modules/lemonldap-ng-portal/example/skins/impact/confirm.tpl @@ -45,8 +45,16 @@ window.setTimeout('timer()',1000); } $(document).ready(function(){ + // Check if timer should be activated (true by default) + var activeTimer = true; + if (!) {activeTimer = false;} + + if (activeTimer) { window.setTimeout('go()',5000); window.setTimeout('timer()',1000); + } else { + stop(); + } }); diff --git a/modules/lemonldap-ng-portal/example/skins/impact/info.tpl b/modules/lemonldap-ng-portal/example/skins/impact/info.tpl index b85cc6749..f7ec237ef 100644 --- a/modules/lemonldap-ng-portal/example/skins/impact/info.tpl +++ b/modules/lemonldap-ng-portal/example/skins/impact/info.tpl @@ -45,8 +45,16 @@ window.setTimeout('timer()',1000); } $(document).ready(function(){ + // Check if timer should be activated (true by default) + var activeTimer = true; + if (!) {activeTimer = false;} + + if (activeTimer) { window.setTimeout('go()',10000); window.setTimeout('timer()',1000); + } else { + stop(); + } }); diff --git a/modules/lemonldap-ng-portal/example/skins/pastel/confirm.tpl b/modules/lemonldap-ng-portal/example/skins/pastel/confirm.tpl index aada74296..09b90f78a 100644 --- a/modules/lemonldap-ng-portal/example/skins/pastel/confirm.tpl +++ b/modules/lemonldap-ng-portal/example/skins/pastel/confirm.tpl @@ -43,8 +43,16 @@ window.setTimeout('timer()',1000); } $(document).ready(function(){ + // Check if timer should be activated (true by default) + var activeTimer = true; + if (!) {activeTimer = false;} + + if (activeTimer) { window.setTimeout('go()',5000); window.setTimeout('timer()',1000); + } else { + stop(); + } }); diff --git a/modules/lemonldap-ng-portal/example/skins/pastel/info.tpl b/modules/lemonldap-ng-portal/example/skins/pastel/info.tpl index 3145d2a8d..027b5a463 100644 --- a/modules/lemonldap-ng-portal/example/skins/pastel/info.tpl +++ b/modules/lemonldap-ng-portal/example/skins/pastel/info.tpl @@ -43,8 +43,16 @@ window.setTimeout('timer()',1000); } $(document).ready(function(){ + // Check if timer should be activated (true by default) + var activeTimer = true; + if (!) {activeTimer = false;} + + if (activeTimer) { window.setTimeout('go()',10000); window.setTimeout('timer()',1000); + } else { + stop(); + } }); 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 7654ffe31..93eb5f819 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthSAML.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/AuthSAML.pm @@ -796,7 +796,7 @@ sub extractFormInfo { foreach ( keys %{ $self->{_idpList} } ) { $html .= - '' . $self->{_idpList}->{$_}->{name} @@ -821,6 +821,9 @@ sub extractFormInfo { $self->info($html); + # Timer not active on IDP list + $self->{activeTimer} = 0; + # Delete existing IDP resolution cookie push @{ $self->{cookie} }, $self->cookie( 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 7963e187f..8bbcc5fad 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm @@ -366,6 +366,7 @@ sub setDefaultValues { $self->{mailUrl} ||= $self->{portal} . "/mail.pl"; $self->{issuerDB} ||= 'Null'; $self->{multiValuesSeparator} ||= '; '; + $self->{activeTimer} = 1 unless ( defined( $self->{activeTimer} ) ); # Set default userDB and passwordDB to DBI if authentication is DBI if ( $self->{authentication} =~ /DBI/i ) {