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 6029b8acd..4d0b72cd8 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/Choice.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Auth/Choice.pm @@ -2,7 +2,7 @@ package Lemonldap::NG::Portal::Auth::Choice; use strict; use Mouse; -use Lemonldap::NG::Portal::Main::Constants qw(PE_OK PE_FIRSTACCESS); +use Lemonldap::NG::Portal::Main::Constants qw(PE_OK PE_FIRSTACCESS PE_ERROR); our $VERSION = '2.0.2'; @@ -25,17 +25,21 @@ sub _authCancel { sub extractFormInfo { my ( $self, $req ) = @_; unless ( $self->checkChoice($req) ) { - $self->logger->debug("Searching for Auth module AJAX init/script..."); + $self->logger->debug("Initializing Auth modules..."); foreach my $mod ( values %{ $self->modules } ) { - if ( $mod->{AjaxInitScript} and $mod->{Name} ) { + if ( $mod->{AjaxInitScript} ) { $self->logger->debug( - 'Append ' . $mod->Name . ' init/script' ); + 'Append ' . $mod->{Name} . ' init/script' ) if $mod->{Name}; $req->data->{customScript} .= $mod->AjaxInitScript; } if ( $mod->{InitCmd} ) { - eval( $mod->{InitCmd} ); - die 'Unable to launch init commmand ' . $mod->{InitCmd} - if ($@); + $self->logger->debug( + 'Launch ' . $mod->{Name} . ' init command' ) if $mod->{Name}; + my $res = eval( $mod->{InitCmd} ); + if ($@) { + $self->logger("Auth error: $@"); + return PE_ERROR; + } } } foreach my $mod ( values %{ $self->modules } ) { 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 3223a832a..20f223317 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm @@ -460,6 +460,7 @@ sub buildHiddenForm { if $self->checkXSSAttack( $_, $req->{portalHiddenFormValues}->{$_} ); # Build hidden input HTML code + #$val .= qq{'; } diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Run.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Run.pm index 073402040..845ef9b34 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Run.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Run.pm @@ -607,7 +607,7 @@ sub autoPost { # 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 fieldname The field name which will contain the corresponding value # @param value The associated value # @param prefix Prefix of the field key # @param base64 Encode value in base64