Commit 3021e998 authored by Christophe Maudoux's avatar Christophe Maudoux

Fix SSL/Kerberos Auth with Choice (#1636)

parent a084ba3c
......@@ -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 } ) {
......
......@@ -460,6 +460,7 @@ sub buildHiddenForm {
if $self->checkXSSAttack( $_, $req->{portalHiddenFormValues}->{$_} );
# Build hidden input HTML code
#$val .= qq{<input type="hidden" name="$_" id="$_" value="}
$val .= qq{<input type="hidden" name="$_" id="$_" value="}
. $req->{portalHiddenFormValues}->{$_} . '" />';
}
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment