Append Portal main logo option in Manager (#1515)

This commit is contained in:
Christophe Maudoux 2018-10-08 23:02:59 +02:00
parent 6ae0035fbb
commit 7a1117d4c4
8 changed files with 27 additions and 14 deletions

View File

@ -179,17 +179,18 @@ sub defaultValues {
'portalDisplayRegister' => 1,
'portalErrorOnExpiredSession' => 1,
'portalForceAuthnInterval' => 5,
'portalPingInterval' => 60000,
'portalRequireOldPassword' => 1,
'portalSkin' => 'bootstrap',
'portalUserAttr' => '_user',
'proxyAuthnLevel' => 2,
'radiusAuthnLevel' => 3,
'randomPasswordRegexp' => '[A-Z]{3}[a-z]{5}.\\d{2}',
'redirectFormMethod' => 'get',
'registerDB' => 'Null',
'registerTimeout' => 0,
'registerUrl' => 'http://auth.example.com/register',
'portalMainLogo' => 'common/logos/logo_llng_400px.png',
'portalPingInterval' => 60000,
'portalRequireOldPassword' => 1,
'portalSkin' => 'bootstrap',
'portalUserAttr' => '_user',
'proxyAuthnLevel' => 2,
'radiusAuthnLevel' => 3,
'randomPasswordRegexp' => '[A-Z]{3}[a-z]{5}.\\d{2}',
'redirectFormMethod' => 'get',
'registerDB' => 'Null',
'registerTimeout' => 0,
'registerUrl' => 'http://auth.example.com/register',
'remoteGlobalStorage' => 'Lemonldap::NG::Common::Apache::Session::SOAP',
'remoteGlobalStorageOptions' => {
'ns' =>

View File

@ -2173,6 +2173,10 @@ qr/(?:(?:https?):\/\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.]
'default' => 5,
'type' => 'int'
},
'portalMainLogo' => {
'default' => 'common/logos/logo_llng_400px.png',
'type' => 'text'
},
'portalOpenLinkInNewWindow' => {
'default' => 0,
'type' => 'bool'

View File

@ -375,6 +375,11 @@ sub attributes {
msgFail => '__badUrl__',
documentation => 'URL to call on reload',
},
portalMainLogo => {
type => 'text',
default => 'common/logos/logo_llng_400px.png',
documentation => 'Portal main logo path',
},
staticPrefix => {
type => 'text',
documentation => 'Prefix of static files for HTML templates',

View File

@ -57,6 +57,7 @@ sub tree {
nodes => [
'portalSkin',
'portalSkinBackground',
'portalMainLogo',
'portalSkinRules',
{
title => 'portalButtons',

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -186,6 +186,7 @@ sub display {
#utf8::decode($auth_user);
%templateParams = (
MAIN_LOGO => $self->conf->{portalMainLogo},
AUTH_USER => $req->{sessionInfo}->{ $self->conf->{portalUserAttr} },
NEWWINDOW => $self->conf->{portalOpenLinkInNewWindow},
LOGOUT_URL => $self->conf->{portal} . "?logout=1",
@ -258,6 +259,7 @@ sub display {
my $login = $self->userId($req);
$login = '' if ( $login eq 'anonymous' );
%templateParams = (
MAIN_LOGO => $self->conf->{portalMainLogo},
AUTH_ERROR => $req->error,
AUTH_ERROR_TYPE => $req->error_type,
AUTH_URL => $req->{data}->{_url},

View File

@ -1,2 +1,2 @@
<!-- Custom HTML header -->
<img src="<TMPL_VAR NAME="STATIC_PREFIX">common/logos/logo_llng_400px.png" class="img-fluid rounded mx-auto d-block" />
<img src="<TMPL_VAR NAME="STATIC_PREFIX"><TMPL_VAR NAME="MAIN_LOGO">" class="img-fluid rounded mx-auto d-block" />