diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/Choice.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/Choice.pm index 4d0b72cd8..55646d243 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/Choice.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/Choice.pm @@ -3,6 +3,7 @@ package Lemonldap::NG::Portal::Auth::Choice; use strict; use Mouse; use Lemonldap::NG::Portal::Main::Constants qw(PE_OK PE_FIRSTACCESS PE_ERROR); +use Data::Dumper; our $VERSION = '2.0.2'; @@ -29,19 +30,24 @@ sub extractFormInfo { foreach my $mod ( values %{ $self->modules } ) { if ( $mod->{AjaxInitScript} ) { $self->logger->debug( - 'Append ' . $mod->{Name} . ' init/script' ) if $mod->{Name}; + 'Append ' . $mod->{Name} . ' init/script' ) + if $mod->{Name}; $req->data->{customScript} .= $mod->AjaxInitScript; } if ( $mod->{InitCmd} ) { $self->logger->debug( - 'Launch ' . $mod->{Name} . ' init command' ) if $mod->{Name}; + 'Launch ' . $mod->{Name} . ' init command' ) + if $mod->{Name}; my $res = eval( $mod->{InitCmd} ); if ($@) { $self->logger("Auth error: $@"); return PE_ERROR; - } + } } } + + $self->logger->debug("@@@@ Req -> " . Dumper($req) ); + foreach my $mod ( values %{ $self->modules } ) { if ( $mod->can('setSecurity') ) { $mod->setSecurity($req); diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/SSL.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/SSL.pm index 6ee7354f4..6537b65fe 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/SSL.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/SSL.pm @@ -55,6 +55,13 @@ sub extractFormInfo { return PE_FIRSTACCESS; } else { + if ( $self->conf->{sslByAjax} ) { + $self->logger->debug( + 'Append ' . $self->{Name} . ' init/script' ); + $req->data->{customScript} .= $self->{AjaxInitScript}; + $self->logger->debug( + "Send init/script -> " . $req->data->{customScript} ); + } $self->userLogger->warn('No certificate found'); return PE_CERTIFICATEREQUIRED; } diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm index 20f223317..8b93dbe0c 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm @@ -460,8 +460,9 @@ sub buildHiddenForm { if $self->checkXSSAttack( $_, $req->{portalHiddenFormValues}->{$_} ); # Build hidden input HTML code + # 'id' is removed to avoid warning with Choice #$val .= qq{'; } diff --git a/lemonldap-ng-portal/t/24-AuthKerberos.t b/lemonldap-ng-portal/t/24-AuthKerberos.t index ab8178d96..7970a09ef 100644 --- a/lemonldap-ng-portal/t/24-AuthKerberos.t +++ b/lemonldap-ng-portal/t/24-AuthKerberos.t @@ -48,7 +48,7 @@ SKIP: { expectForm( $res, '#', undef, 'kerberos' ); ok( $res->[2]->[0] - =~ m%%, + =~ m%%, 'Found hidden attribut "kerberos" with value="0"' ) or print STDERR Dumper( $res->[2]->[0] ); ok( $res->[2]->[0] =~ /kerberos\.(?:min\.)?js/, diff --git a/lemonldap-ng-portal/t/28-AuthChoice-with-rules.t b/lemonldap-ng-portal/t/28-AuthChoice-with-rules.t index 83b43b033..0abf50361 100644 --- a/lemonldap-ng-portal/t/28-AuthChoice-with-rules.t +++ b/lemonldap-ng-portal/t/28-AuthChoice-with-rules.t @@ -83,7 +83,7 @@ SKIP: { ) or print STDERR Dumper( $res->[2]->[0] ); expectForm( $res, '#', undef, 'kerberos' ); ok( $res->[2]->[0] - =~ m%%, + =~ m%%, 'Found hidden attribut "kerberos" with value="0"' ) or print STDERR Dumper( $res->[2]->[0] ); ok( $res->[2]->[0] =~ /kerberosChoice\.(?:min\.)?js/,