From 8ca60a9238616b3c2c4080e931473250f8f89825 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20OUDOT?= Date: Tue, 5 Feb 2019 18:39:43 +0100 Subject: [PATCH] Do not set portal background in CSS if no value is configured (#1643) --- .../lib/Lemonldap/NG/Portal/Main/Run.pm | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) 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 845ef9b34..8bd4505bc 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Run.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Run.pm @@ -793,13 +793,16 @@ sub sendHtml { sub sendCss { my ( $self, $req ) = @_; - my $s = - 'html,body{background:url("' - . $self->staticPrefix - . '/common/backgrounds/' - . $self->conf->{portalSkinBackground} - . '") no-repeat center fixed;' - . 'background-size:cover;}'; + my $s = '/* LL::NG Portal CSS */'; + if ( $self->conf->{portalSkinBackground} ) { + $s .= + 'html,body{background:url("' + . $self->staticPrefix + . '/common/backgrounds/' + . $self->conf->{portalSkinBackground} + . '") no-repeat center fixed;' + . 'background-size:cover;}'; + } return [ 200, [ @@ -852,7 +855,7 @@ sub tplParams { for my $session_key ( keys %{ $req->{sessionInfo} } ) { $templateParams{ "session_" . $session_key } = - $req->{sessionInfo}->{$session_key}; + $req->{sessionInfo}->{$session_key}; } for my $env_key ( keys %{ $req->env } ) { @@ -860,7 +863,7 @@ sub tplParams { } return ( - SKIN => $self->getSkin( $req ), + SKIN => $self->getSkin($req), PORTAL_URL => $self->conf->{portal}, SKIN_PATH => $portalPath . "skins", ANTIFRAME => $self->conf->{portalAntiFrame},