Commit 73bba9f6 authored by Christophe Maudoux's avatar Christophe Maudoux

Merge branch 'v2.0' of gitlab.ow2.org:lemonldap-ng/lemonldap-ng into v2.0

parents c4b018ee b63dd147
......@@ -418,14 +418,6 @@ sub display {
}
# Additional $req param
%templateParams = ( %templateParams, %{ $req->{customParameters} // {} }, );
for my $session_key ( keys %{ $req->{sessionInfo} } ) {
$templateParams{ "session_" . $session_key } =
$req->{sessionInfo}->{$session_key};
}
$self->logger->debug("Skin returned: $skinfile");
return ( $skinfile, \%templateParams );
}
......
......@@ -9,7 +9,7 @@
#
package Lemonldap::NG::Portal::Main::Run;
our $VERSION = '2.0.1';
our $VERSION = '2.0.2';
package Lemonldap::NG::Portal::Main;
......@@ -843,16 +843,30 @@ sub rebuildCookies {
}
sub tplParams {
my $portalPath = $_[0]->conf->{portal};
my ( $self, $req ) = @_;
my %templateParams;
my $portalPath = $self->conf->{portal};
$portalPath =~ s#^https?://[^/]+/?#/#;
$portalPath =~ s#[^/]+\.fcgi$##;
for my $session_key ( keys %{ $req->{sessionInfo} } ) {
$templateParams{ "session_" . $session_key } =
$req->{sessionInfo}->{$session_key};
}
for my $env_key ( keys %{ $req->env } ) {
$templateParams{ "env_" . $env_key } = $req->env->{$env_key};
}
return (
SKIN => $_[0]->getSkin( $_[1] ),
PORTAL_URL => $_[0]->conf->{portal},
SKIN => $self->getSkin( $req ),
PORTAL_URL => $self->conf->{portal},
SKIN_PATH => $portalPath . "skins",
ANTIFRAME => $_[0]->conf->{portalAntiFrame},
SKIN_BG => $_[0]->conf->{portalSkinBackground},
( $_[0]->customParameters ? ( %{ $_[0]->customParameters } ) : () ),
ANTIFRAME => $self->conf->{portalAntiFrame},
SKIN_BG => $self->conf->{portalSkinBackground},
( $self->customParameters ? ( %{ $self->customParameters } ) : () ),
%templateParams
);
}
......
......@@ -594,12 +594,6 @@ sub display {
$tplPrm{DISPLAY_PASSWORD_FORM} = $req->sessionInfo->{pwdAllowed};
}
# Custom template parameters
if ( my $customParams = $self->p->customParameters ) {
foreach ( keys %$customParams ) {
$tplPrm{$_} = $customParams->{$_};
}
}
return 'mail', \%tplPrm;
}
......
......@@ -521,6 +521,7 @@ sub display {
DISPLAY_PASSWORD_FORM => 1,
);
}
return ( 'register', \%templateParams );
}
......
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