Append favicon option (#2750)

This commit is contained in:
Christophe Maudoux 2022-05-16 22:32:11 +02:00
parent 91a5aabf0b
commit 17328aa2aa
21 changed files with 51 additions and 10 deletions

View File

@ -15,13 +15,25 @@ Portal > Customization > Main logo.
A blank value disables Main logo display.
.. tip::
- Logo files must be stored in lemonldap-ng-portal/site/htdocs/static/my/path directory
- Logo file path must be like my/path/logo.png
- Main logo is included in Portal templates AND mail body
Favicon
~~~~~~~~~~~~~~~~~~~~~
You can change the default favicon in Manager: General Parameters >
Portal > Customization > Favicon.
A blank value displays default favicon ``common/favicon.ico``.
.. tip::
- Logo files must be stored in lemonldap-ng-portal/site/htdocs/static/my/path directory
- Logo file path must be like my/path/logo.ico
Show languages choice
~~~~~~~~~~~~~~~~~~~~~
@ -33,8 +45,6 @@ Option enabled by default.
.. tip::
If languages choice is disabled, Portal displays accepted languages by
your browser (EN by default).

View File

@ -266,6 +266,7 @@ sub defaultValues {
'portalDisplayRefreshMyRights' => 1,
'portalDisplayRegister' => 1,
'portalErrorOnExpiredSession' => 1,
'portalFavicon' => 'common/favicon.ico',
'portalForceAuthnInterval' => 5,
'portalMainLogo' => 'common/logos/logo_llng_400px.png',
'portalPingInterval' => 60000,

View File

@ -2900,6 +2900,10 @@ qr/(?:(?:https?):\/\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.]
'default' => 0,
'type' => 'bool'
},
'portalFavicon' => {
'default' => 'common/favicon.ico',
'type' => 'text'
},
'portalForceAuthn' => {
'default' => 0,
'type' => 'bool'

View File

@ -368,6 +368,11 @@ sub attributes {
test => $url,
msgFail => '__badUrl__',
},
portalFavicon => {
type => 'text',
default => 'common/favicon.ico',
documentation => 'Path to favicon file',
},
portalCustomCss => {
type => 'text',
documentation => 'Path to custom CSS file',

View File

@ -53,6 +53,7 @@ sub tree {
help => 'portalcustom.html',
nodes => [
'portalMainLogo',
'portalFavicon',
'showLanguages',
'portalCustomCss',
'portalSkin',

View File

@ -806,6 +806,7 @@
"portalEnablePasswordDisplay":"Allow to display password",
"portalErrorOnExpiredSession":"عرض الخطأ في الجلسة المنتهية صلحيتها",
"portalErrorOnMailNotFound":"إظهار الخطأ في البريد الغيرالموجود",
"portalFavicon":"Favicon",
"portalForceAuthn":"فرض إثبات الهوية",
"portalForceAuthnInterval":"فرض الفاصل الزمني لإثبات الهوية",
"portalMainLogo":"Main logo",

View File

@ -806,6 +806,7 @@
"portalEnablePasswordDisplay":"Allow to display password",
"portalErrorOnExpiredSession":"Show error on expired session",
"portalErrorOnMailNotFound":"Show error on mail not found",
"portalFavicon":"Favicon",
"portalForceAuthn":"Force authentication",
"portalForceAuthnInterval":"Force authentication interval",
"portalMainLogo":"Main logo",

View File

@ -806,6 +806,7 @@
"portalEnablePasswordDisplay":"Allow to display password",
"portalErrorOnExpiredSession":"Mostrar error en sesión caducada",
"portalErrorOnMailNotFound":"Mostrar error cuando no se encuentra el email",
"portalFavicon":"Favicon",
"portalForceAuthn":"Forzar autentificación",
"portalForceAuthnInterval":"Force authentication interval",
"portalMainLogo":"Logotipo principal",

View File

@ -806,6 +806,7 @@
"portalEnablePasswordDisplay":"Permettre d'afficher le mot de passe",
"portalErrorOnExpiredSession":"Affiche une erreur si la session est expirée",
"portalErrorOnMailNotFound":"Affiche une erreur si le mail n'est pas trouvé",
"portalFavicon":"Favicon",
"portalForceAuthn":"Authentification forcée",
"portalForceAuthnInterval":"Intervalle d'authentification forcée",
"portalMainLogo":"Logo principal",

View File

@ -806,6 +806,7 @@
"portalEnablePasswordDisplay":"Allow to display password",
"portalErrorOnExpiredSession":"Show error on expired session",
"portalErrorOnMailNotFound":"Show error on mail not found",
"portalFavicon":"Favicon",
"portalForceAuthn":"אילוץ אימות",
"portalForceAuthnInterval":"Force authentication interval",
"portalMainLogo":"לוגו ראשי",

View File

@ -806,6 +806,7 @@
"portalEnablePasswordDisplay":"Allow to display password",
"portalErrorOnExpiredSession":"Mostra errore nella sessione scaduta",
"portalErrorOnMailNotFound":"Mostra errore sulla posta non trovata",
"portalFavicon":"Favicon",
"portalForceAuthn":"Forza l'autenticazione",
"portalForceAuthnInterval":"Forza intervallo di autenticazione",
"portalMainLogo":"Logo principale",

View File

@ -806,6 +806,7 @@
"portalEnablePasswordDisplay":"Allow to display password",
"portalErrorOnExpiredSession":"Pokaż błąd w wygasłej sesji",
"portalErrorOnMailNotFound":"Pokaż błąd w poczcie nie znaleziono",
"portalFavicon":"Favicon",
"portalForceAuthn":"Wymuś uwierzytelnienie",
"portalForceAuthnInterval":"Wymuś interwał uwierzytelnienia",
"portalMainLogo":"Główne logo",

View File

@ -806,6 +806,7 @@
"portalEnablePasswordDisplay":"Parolayı göstermeye izin ver",
"portalErrorOnExpiredSession":"Süresi dolmuş oturumda hatayı göster",
"portalErrorOnMailNotFound":"E-posta bulunamadığında hatayı göster",
"portalFavicon":"Favicon",
"portalForceAuthn":"Kimlik doğrulamaya zorla",
"portalForceAuthnInterval":"Kimlik doğrulama aralığını zorla",
"portalMainLogo":"Ana logo",

View File

@ -806,6 +806,7 @@
"portalEnablePasswordDisplay":"Allow to display password",
"portalErrorOnExpiredSession":"Show error on expired session",
"portalErrorOnMailNotFound":"Show error on mail not found",
"portalFavicon":"Favicon",
"portalForceAuthn":"Bắt buộc xác thực",
"portalForceAuthnInterval":"Khoảng thời gian bắt buộc xác thực",
"portalMainLogo":"Main logo",

View File

@ -806,6 +806,7 @@
"portalEnablePasswordDisplay":"Allow to display password",
"portalErrorOnExpiredSession":"在過期的工作階段上顯示錯誤",
"portalErrorOnMailNotFound":"找不到郵件時顯示錯誤",
"portalFavicon":"Favicon",
"portalForceAuthn":"強制驗證",
"portalForceAuthnInterval":"強制驗證間隔",
"portalMainLogo":"主圖示",

View File

@ -806,6 +806,7 @@
"portalEnablePasswordDisplay":"Allow to display password",
"portalErrorOnExpiredSession":"在過期的工作階段上顯示錯誤",
"portalErrorOnMailNotFound":"找不到郵件時顯示錯誤",
"portalFavicon":"Favicon",
"portalForceAuthn":"強制驗證",
"portalForceAuthnInterval":"強制驗證間隔",
"portalMainLogo":"主圖示",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1049,6 +1049,7 @@ sub tplParams {
SKIN_PATH => $portalPath . "skins",
SAMESITE => getSameSite( $self->conf ),
SKIN_BG => $self->conf->{portalSkinBackground},
FAVICON => $self->conf->{portalFavicon} || 'common/favicon.ico',
CUSTOM_CSS => $self->conf->{portalCustomCss},
(
$self->customParameters

View File

@ -36,8 +36,8 @@
<script type="text/javascript" src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script type="text/javascript" src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
<link href="<TMPL_VAR NAME="STATIC_PREFIX">common/favicon.ico" rel="icon" type="image/vnd.microsoft.icon" sizes="16x16 32x32 48x48 64x64 128x128" />
<link href="<TMPL_VAR NAME="STATIC_PREFIX">common/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" sizes="16x16 32x32 48x48 64x64 128x128" />
<link href="<TMPL_VAR NAME="STATIC_PREFIX"><TMPL_VAR NAME="FAVICON">" rel="icon" type="image/vnd.microsoft.icon" sizes="16x16 32x32 48x48 64x64 128x128" />
<link href="<TMPL_VAR NAME="STATIC_PREFIX"><TMPL_VAR NAME="FAVICON">" rel="shortcut icon" type="image/vnd.microsoft.icon" sizes="16x16 32x32 48x48 64x64 128x128" />
<TMPL_IF NAME="PROVIDERURI">
<link rel="openid.server" href="<TMPL_VAR NAME="PROVIDERURI">" />
<link rel="openid2.provider" href="<TMPL_VAR NAME="PROVIDERURI">" />

View File

@ -9,8 +9,14 @@ require 't/test-lib.pm';
my $res;
my $client = LLNG::Manager::Test->new(
{ ini => { logLevel => 'error', useSafeJail => 1 } } );
my $client = LLNG::Manager::Test->new( {
ini => {
logLevel => 'error',
useSafeJail => 1,
portalFavicon => 'common/llng.ico'
}
}
);
# Test normal first access
# ------------------------
@ -31,7 +37,9 @@ ok( $res->[2]->[0] =~ /<span trmsg="37">/, 'Rejected with PE_BADURL' )
or print STDERR Dumper( $res->[2]->[0] );
ok( $res->[2]->[0] =~ m%<span id="languages"></span>%, ' Language icons found' )
or print STDERR Dumper( $res->[2]->[0] );
count(3);
ok( $res->[2]->[0] =~ m%link href="/static/common/llng.ico%, ' Custom favicon found' )
or print STDERR Dumper( $res->[2]->[0] );
count(4);
# Test "first access" with a wildcard-protected url
ok(