rememberAuthChoice: resolve conflicts with 2.0 branch (#2737)

This commit is contained in:
David Coutadeur 2022-05-17 09:57:45 +00:00
commit ed03ce6a8e
35 changed files with 246 additions and 126 deletions

View File

@ -10,9 +10,10 @@ Issuer identifier
~~~~~~~~~~~~~~~~~
Set the issuer identifier, which should be the portal URL.
For example: http://auth.example.com
Set a blank value to use Portal URL.
Endpoints
~~~~~~~~~~

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

@ -262,6 +262,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

@ -2882,6 +2882,10 @@ sub attributes {
'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',
@ -77,9 +78,9 @@ sub tree {
form => 'simpleInputContainer',
nodes => [
'portalRequireOldPassword',
'portalEnablePasswordDisplay',
'hideOldPassword',
'mailOnPasswordChange',
'portalEnablePasswordDisplay',
]
},
{

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

@ -34,11 +34,11 @@
<li ng-include="'languages.html'"/>
<li role="separator" class="divider"></li>
<li class="dropdown-header"><span ng-bind="translate('version')"></span></li>
<li><a href="https://lemonldap-ng.org/team" name="version"><TMPL_VAR NAME="VERSION"></a></li>
<li><a href="https://projects.ow2.org/view/lemonldap-ng" name="version"><TMPL_VAR NAME="VERSION"></a></li>
<TMPL_IF NAME="INSTANCE_NAME">
<li role="separator" class="divider"></li>
<li class="dropdown-header"><span ng-bind="translate('instance')"></span></li>
<li><a href="https://lemonldap-ng.org"><TMPL_VAR NAME="INSTANCE_NAME"></a></li>
<li><a href="https://lemonldap-ng.org/team.html"><TMPL_VAR NAME="INSTANCE_NAME"></a></li>
</TMPL_IF>
</ul>
</li>

View File

@ -270,18 +270,20 @@ sub display {
LANGS => $self->conf->{showLanguages},
AUTH_USER => $req->{sessionInfo}->{ $self->conf->{portalUserAttr} },
NEWWINDOW => $self->conf->{portalOpenLinkInNewWindow},
LOGOUT_URL => $self->conf->{portal} . "?logout=1",
APPSLIST_ORDER => $req->{sessionInfo}->{'_appsListOrder'},
PING => $self->conf->{portalPingInterval},
DONT_STORE_PASSWORD => $self->conf->{browsersDontStorePassword},
HIDE_OLDPASSWORD => 0,
PPOLICY_NOPOLICY => !$self->isPP(),
DISPLAY_PPOLICY => $self->conf->{portalDisplayPasswordPolicy},
PPOLICY_MINSIZE => $self->conf->{passwordPolicyMinSize},
PPOLICY_MINLOWER => $self->conf->{passwordPolicyMinLower},
PPOLICY_MINUPPER => $self->conf->{passwordPolicyMinUpper},
PPOLICY_MINDIGIT => $self->conf->{passwordPolicyMinDigit},
PPOLICY_MINSPECHAR => $self->conf->{passwordPolicyMinSpeChar},
LOGOUT_URL => $self->conf->{portal} . "?logout=1",
APPSLIST_ORDER => $req->{sessionInfo}->{'_appsListOrder'},
PING => $self->conf->{portalPingInterval},
DONT_STORE_PASSWORD => $self->conf->{browsersDontStorePassword},
HIDE_OLDPASSWORD => 0,
PPOLICY_NOPOLICY => !$self->isPP(),
ENABLE_PASSWORD_DISPLAY =>
$self->conf->{portalEnablePasswordDisplay},
DISPLAY_PPOLICY => $self->conf->{portalDisplayPasswordPolicy},
PPOLICY_MINSIZE => $self->conf->{passwordPolicyMinSize},
PPOLICY_MINLOWER => $self->conf->{passwordPolicyMinLower},
PPOLICY_MINUPPER => $self->conf->{passwordPolicyMinUpper},
PPOLICY_MINDIGIT => $self->conf->{passwordPolicyMinDigit},
PPOLICY_MINSPECHAR => $self->conf->{passwordPolicyMinSpeChar},
(
$self->requireOldPwd->( $req, $req->userData )
? ( REQUIRE_OLDPASSWORD => 1 )
@ -504,6 +506,8 @@ sub display {
HIDE_OLDPASSWORD => $self->conf->{hideOldPassword},
DONT_STORE_PASSWORD => $self->conf->{browsersDontStorePassword},
PPOLICY_NOPOLICY => !$self->isPP(),
ENABLE_PASSWORD_DISPLAY =>
$self->conf->{portalEnablePasswordDisplay},
DISPLAY_PPOLICY => $self->conf->{portalDisplayPasswordPolicy},
PPOLICY_MINSIZE => $self->conf->{passwordPolicyMinSize},
PPOLICY_MINLOWER => $self->conf->{passwordPolicyMinLower},

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

@ -633,6 +633,8 @@ sub display {
DISPLAY_CONFIRMMAILSENT => 0,
DISPLAY_MAILSENT => 0,
DISPLAY_PASSWORD_FORM => 0,
ENABLE_PASSWORD_DISPLAY => $self->conf->{portalEnablePasswordDisplay},
DONT_STORE_PASSWORD => $self->conf->{browsersDontStorePassword},
DISPLAY_PPOLICY => $self->conf->{portalDisplayPasswordPolicy} && $isPP,
PPOLICY_MINSIZE => $self->conf->{passwordPolicyMinSize},
PPOLICY_MINLOWER => $self->conf->{passwordPolicyMinLower},

View File

@ -491,20 +491,27 @@ $(window).on 'load', () ->
# Functions to show/hide display password button
if datas['enablePasswordDisplay']
field = ''
if datas['dontStorePassword']
$(".toggle-password").mousedown () ->
field = $(this).attr 'id'
field = field.replace /^toggle_/, ''
console.log 'Display', field
$(this).toggleClass("fa-eye fa-eye-slash")
$("input[name=password]").attr('class', 'form-control')
$("input[name=#{field}]").attr('class', 'form-control')
$(".toggle-password").mouseup () ->
$(this).toggleClass("fa-eye fa-eye-slash")
$("input[name=password]").attr('class', 'form-control key') if $("input[name=password]").get(0).value
$("input[name=#{field}]").attr('class', 'form-control key') if $("input[name=#{field}]").get(0).value
else
$(".toggle-password").mousedown () ->
field = $(this).attr 'id'
field = field.replace /^toggle_/, ''
console.log 'Display', field
$(this).toggleClass("fa-eye fa-eye-slash")
$("input[name=password]").attr("type", "text")
$("input[name=#{field}]").attr("type", "text")
$(".toggle-password").mouseup () ->
$(this).toggleClass("fa-eye fa-eye-slash")
$("input[name=password]").attr("type", "password")
$("input[name=#{field}]").attr("type", "password")
# Ping if asked
if datas['pingInterval'] and datas['pingInterval'] > 0
@ -518,31 +525,6 @@ $(window).on 'load', () ->
$('.oidcConsent').on 'click', () ->
removeOidcConsent $(this).attr 'partner'
# Functions to show/hide change password inputs
$('#show-hide-button').on 'click', () ->
if datas['dontStorePassword']
if $("#newpassword").attr('class') == 'form-control key' || $("#confirmpassword").attr('class') == 'form-control key'
console.log 'Show passwords'
$("#newpassword").attr('class', 'form-control')
$("#confirmpassword").attr('class', 'form-control')
$("#show-hide-icon-button").attr('class', 'fa fa-eye-slash')
else
console.log 'Hide passwords'
$("#newpassword").attr('class', 'form-control key') if $("#newpassword").get(0).value
$("#confirmpassword").attr('class', 'form-control key') if $("#confirmpassword").get(0).value
$("#show-hide-icon-button").attr('class', 'fa fa-eye') if ($("#newpassword").get(0).value || $("#confirmpassword").get(0).value)
else
if $("#newpassword").attr('type') == 'password'
console.log 'Show passwords'
$("#newpassword").attr('type', 'text')
$("#confirmpassword").attr('type', 'text')
$("#show-hide-icon-button").attr('class', 'fa fa-eye-slash')
else
console.log 'Hide passwords'
$("#newpassword").attr('type', 'password')
$("#confirmpassword").attr('type', 'password')
$("#show-hide-icon-button").attr('class', 'fa fa-eye')
# Functions to show/hide placeholder password inputs
$('#passwordfield').on 'input', () ->
if $('#passwordfield').get(0).value && datas['dontStorePassword']
@ -556,12 +538,12 @@ $(window).on 'load', () ->
$("#oldpassword").attr('class', 'form-control')
$('#newpassword').on 'input', () ->
if $('#newpassword').get(0).value && datas['dontStorePassword']
$("#newpassword").attr('class', 'form-control key') if $("#show-hide-icon-button").attr('class') == 'fa fa-eye'
$("#newpassword").attr('class', 'form-control key')
else
$("#newpassword").attr('class', 'form-control')
$('#confirmpassword').on 'input', () ->
if $('#confirmpassword').get(0).value && datas['dontStorePassword']
$("#confirmpassword").attr('class', 'form-control key') if $("#show-hide-icon-button").attr('class') == 'fa fa-eye'
$("#confirmpassword").attr('class', 'form-control key')
else
$("#confirmpassword").attr('class', 'form-control')

View File

@ -252,7 +252,7 @@ LemonLDAP::NG Portal jQuery scripts
datas = {};
$(window).on('load', function() {
var action, al, authMenuIndex, authMenuTabs, back_url, checkpassword, checksamepass, hiddenParams, isAlphaNumeric, l, lang, langdiv, langs, langs2, len1, len2, len3, len4, link, m, menuIndex, menuTabs, method, n, nl, nlangs, o, queryLang, re, ref, ref1, ref2, setCookieLang, togglecheckpassword;
var action, al, authMenuIndex, authMenuTabs, back_url, checkpassword, checksamepass, field, hiddenParams, isAlphaNumeric, l, lang, langdiv, langs, langs2, len1, len2, len3, len4, link, m, menuIndex, menuTabs, method, n, nl, nlangs, o, queryLang, re, ref, ref1, ref2, setCookieLang, togglecheckpassword;
datas = getValues();
if ("datas" in window && "choicetab" in window.datas) {
datas.choicetab = window.datas.choicetab;
@ -546,25 +546,34 @@ LemonLDAP::NG Portal jQuery scripts
$('#reset').change(togglecheckpassword);
}
if (datas['enablePasswordDisplay']) {
field = '';
if (datas['dontStorePassword']) {
$(".toggle-password").mousedown(function() {
field = $(this).attr('id');
console.log('Display****', field);
field = field.replace(/^toggle_/, '');
console.log('Display', field);
$(this).toggleClass("fa-eye fa-eye-slash");
return $("input[name=password]").attr('class', 'form-control');
return $("input[name=" + field + "]").attr('class', 'form-control');
});
$(".toggle-password").mouseup(function() {
$(this).toggleClass("fa-eye fa-eye-slash");
if ($("input[name=password]").get(0).value) {
return $("input[name=password]").attr('class', 'form-control key');
if ($("input[name=" + field + "]").get(0).value) {
return $("input[name=" + field + "]").attr('class', 'form-control key');
}
});
} else {
$(".toggle-password").mousedown(function() {
field = $(this).attr('id');
console.log('Display***', field);
field = field.replace(/^toggle_/, '');
console.log('Display', field);
$(this).toggleClass("fa-eye fa-eye-slash");
return $("input[name=password]").attr("type", "text");
return $("input[name=" + field + "]").attr("type", "text");
});
$(".toggle-password").mouseup(function() {
$(this).toggleClass("fa-eye fa-eye-slash");
return $("input[name=password]").attr("type", "password");
return $("input[name=" + field + "]").attr("type", "password");
});
}
}
@ -579,39 +588,6 @@ LemonLDAP::NG Portal jQuery scripts
$('.oidcConsent').on('click', function() {
return removeOidcConsent($(this).attr('partner'));
});
$('#show-hide-button').on('click', function() {
if (datas['dontStorePassword']) {
if ($("#newpassword").attr('class') === 'form-control key' || $("#confirmpassword").attr('class') === 'form-control key') {
console.log('Show passwords');
$("#newpassword").attr('class', 'form-control');
$("#confirmpassword").attr('class', 'form-control');
return $("#show-hide-icon-button").attr('class', 'fa fa-eye-slash');
} else {
console.log('Hide passwords');
if ($("#newpassword").get(0).value) {
$("#newpassword").attr('class', 'form-control key');
}
if ($("#confirmpassword").get(0).value) {
$("#confirmpassword").attr('class', 'form-control key');
}
if ($("#newpassword").get(0).value || $("#confirmpassword").get(0).value) {
return $("#show-hide-icon-button").attr('class', 'fa fa-eye');
}
}
} else {
if ($("#newpassword").attr('type') === 'password') {
console.log('Show passwords');
$("#newpassword").attr('type', 'text');
$("#confirmpassword").attr('type', 'text');
return $("#show-hide-icon-button").attr('class', 'fa fa-eye-slash');
} else {
console.log('Hide passwords');
$("#newpassword").attr('type', 'password');
$("#confirmpassword").attr('type', 'password');
return $("#show-hide-icon-button").attr('class', 'fa fa-eye');
}
}
});
$('#passwordfield').on('input', function() {
if ($('#passwordfield').get(0).value && datas['dontStorePassword']) {
return $("#passwordfield").attr('class', 'form-control key');
@ -628,18 +604,14 @@ LemonLDAP::NG Portal jQuery scripts
});
$('#newpassword').on('input', function() {
if ($('#newpassword').get(0).value && datas['dontStorePassword']) {
if ($("#show-hide-icon-button").attr('class') === 'fa fa-eye') {
return $("#newpassword").attr('class', 'form-control key');
}
return $("#newpassword").attr('class', 'form-control key');
} else {
return $("#newpassword").attr('class', 'form-control');
}
});
$('#confirmpassword').on('input', function() {
if ($('#confirmpassword').get(0).value && datas['dontStorePassword']) {
if ($("#show-hide-icon-button").attr('class') === 'fa fa-eye') {
return $("#confirmpassword").attr('class', 'form-control key');
}
return $("#confirmpassword").attr('class', 'form-control key');
} else {
return $("#confirmpassword").attr('class', 'form-control');
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

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

@ -120,14 +120,42 @@
<div class="input-group-prepend">
<span class="input-group-text"><label for="newpassword" class="mb-0"><i class="fa fa-lock"></i></label></span>
</div>
<input id="newpassword" name="newpassword" type="password" class="form-control" trplaceholder="newPassword" />
<TMPL_IF NAME="DONT_STORE_PASSWORD">
<input id="newpassword" name="newpassword" type="text" class="form-control" trplaceholder="newPassword" autocomplete="off" required aria-required="true"/>
<TMPL_IF NAME="ENABLE_PASSWORD_DISPLAY">
<div class="input-group-append">
<span class="input-group-text"><i id="toggle_newpassword" class="fa fa-eye-slash toggle-password"></i></span>
</div>
</TMPL_IF>
<TMPL_ELSE>
<input id="newpassword" name="newpassword" type="password" class="form-control" trplaceholder="newPassword" required aria-required="true"/>
<TMPL_IF NAME="ENABLE_PASSWORD_DISPLAY">
<div class="input-group-append">
<span class="input-group-text"><i id="toggle_newpassword" class="fa fa-eye-slash toggle-password"></i></span>
</div>
</TMPL_IF>
</TMPL_IF>
</div>
<div class="input-group mb-3">
<div class="form-group input-group">
<div class="input-group-prepend">
<span class="input-group-text"><label for="confirmpassword" class="mb-0"><i class="fa fa-lock"></i></label></span>
</div>
<input id="confirmpassword" name="confirmpassword" type="password" class="form-control" trplaceholder="confirmPwd" />
<TMPL_IF NAME="DONT_STORE_PASSWORD">
<input id="confirmpassword" name="confirmpassword" type="text" class="form-control" trplaceholder="confirmPwd" autocomplete="off" required aria-required="true"/>
<TMPL_IF NAME="ENABLE_PASSWORD_DISPLAY">
<div class="input-group-append">
<span class="input-group-text"><i id="toggle_confirmpassword" class="fa fa-eye-slash toggle-password"></i></span>
</div>
</TMPL_IF>
<TMPL_ELSE>
<input id="confirmpassword" name="confirmpassword" type="password" class="form-control" trplaceholder="confirmPwd" required aria-required="true"/>
<TMPL_IF NAME="ENABLE_PASSWORD_DISPLAY">
<div class="input-group-append">
<span class="input-group-text"><i id="toggle_confirmpassword" class="fa fa-eye-slash toggle-password"></i></span>
</div>
</TMPL_IF>
</TMPL_IF>
</div>
<TMPL_IF NAME="DISPLAY_GENERATE_PASSWORD">

View File

@ -35,8 +35,18 @@
</div>
<TMPL_IF NAME="DONT_STORE_PASSWORD">
<input id="oldpassword" name="oldpassword" type="text" value="<TMPL_VAR NAME=OLDPASSWORD>" class="form-control" trplaceholder="currentPwd" autocomplete="off" required aria-required="true">
<TMPL_IF NAME="ENABLE_PASSWORD_DISPLAY">
<div class="input-group-append">
<span class="input-group-text"><i id="toggle_oldpassword" class="fa fa-eye-slash toggle-password"></i></span>
</div>
</TMPL_IF>
<TMPL_ELSE>
<input id="oldpassword" name="oldpassword" type="password" value="<TMPL_VAR NAME=OLDPASSWORD>" class="form-control" trplaceholder="currentPwd" required aria-required="true">
<TMPL_IF NAME="ENABLE_PASSWORD_DISPLAY">
<div class="input-group-append">
<span class="input-group-text"><i id="toggle_oldpassword" class="fa fa-eye-slash toggle-password"></i></span>
</div>
</TMPL_IF>
</TMPL_IF>
</div>
</TMPL_IF>
@ -50,8 +60,18 @@
</div>
<TMPL_IF NAME="DONT_STORE_PASSWORD">
<input id="newpassword" name="newpassword" type="text" class="form-control" trplaceholder="newPassword" autocomplete="off" required aria-required="true"/>
<TMPL_IF NAME="ENABLE_PASSWORD_DISPLAY">
<div class="input-group-append">
<span class="input-group-text"><i id="toggle_newpassword" class="fa fa-eye-slash toggle-password"></i></span>
</div>
</TMPL_IF>
<TMPL_ELSE>
<input id="newpassword" name="newpassword" type="password" class="form-control" trplaceholder="newPassword" required aria-required="true"/>
<TMPL_IF NAME="ENABLE_PASSWORD_DISPLAY">
<div class="input-group-append">
<span class="input-group-text"><i id="toggle_newpassword" class="fa fa-eye-slash toggle-password"></i></span>
</div>
</TMPL_IF>
</TMPL_IF>
</div>
<div class="form-group input-group">
@ -60,8 +80,18 @@
</div>
<TMPL_IF NAME="DONT_STORE_PASSWORD">
<input id="confirmpassword" name="confirmpassword" type="text" class="form-control" trplaceholder="confirmPwd" autocomplete="off" required aria-required="true"/>
<TMPL_IF NAME="ENABLE_PASSWORD_DISPLAY">
<div class="input-group-append">
<span class="input-group-text"><i id="toggle_confirmpassword" class="fa fa-eye-slash toggle-password"></i></span>
</div>
</TMPL_IF>
<TMPL_ELSE>
<input id="confirmpassword" name="confirmpassword" type="password" class="form-control" trplaceholder="confirmPwd" required aria-required="true"/>
<TMPL_IF NAME="ENABLE_PASSWORD_DISPLAY">
<div class="input-group-append">
<span class="input-group-text"><i id="toggle_confirmpassword" class="fa fa-eye-slash toggle-password"></i></span>
</div>
</TMPL_IF>
</TMPL_IF>
</div>
<div class="buttons">
@ -69,10 +99,6 @@
<span class="fa fa-check-circle"></span>
<span trspan="submit">Submit</span>
</button>
<span id="show-hide-button" class="btn btn-info" role="button">
<span id='show-hide-icon-button' class="fa fa-eye"></span>
<span trspan="showhidePasswords">Show/Hide passwords</span>
</span>
</div>
</div>
</form>

View File

@ -20,14 +20,14 @@
<input id="passwordfield" name="password" type="text" class="form-control" trplaceholder="password" autocomplete="off" required aria-required="true" aria-hidden="true"/>
<TMPL_IF NAME="ENABLE_PASSWORD_DISPLAY">
<div class="input-group-append">
<span class="input-group-text"><i class="fa fa-eye-slash toggle-password"></i></span>
<span class="input-group-text"><i id="toggle_password" class="fa fa-eye-slash toggle-password"></i></span>
</div>
</TMPL_IF>
<TMPL_ELSE>
<input id="passwordfield" name="password" type="password" class="form-control" trplaceholder="password" required aria-required="true"/>
<TMPL_IF NAME="ENABLE_PASSWORD_DISPLAY">
<div class="input-group-append">
<span class="input-group-text"><i class="fa fa-eye-slash toggle-password"></i></span>
<span class="input-group-text"><i id="toggle_password" class="fa fa-eye-slash toggle-password"></i></span>
</div>
</TMPL_IF>
</TMPL_IF>

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(

View File

@ -1,4 +1,5 @@
use Test::More;
use IO::String;
use strict;
require 't/test-lib.pm';
@ -7,19 +8,64 @@ my $res;
my $client = LLNG::Manager::Test->new( {
ini => {
logLevel => 'error',
'portalEnablePasswordDisplay' => 1,
'browsersDontStorePassword' => 1
logLevel => 'error',
portalEnablePasswordDisplay => 1,
browsersDontStorePassword => 1
}
}
);
ok( $res = $client->_get( '/', accept => 'text/html' ), 'Display portal' );
ok( $res->[2]->[0] =~ m%<i class="fa fa-eye-slash toggle-password">%,
' toggle password icon found' )
or print STDERR Dumper( $res->[2]->[0] );
ok(
$res->[2]->[0] =~
m%<i id="toggle_password" class="fa fa-eye-slash toggle-password">%,
' toggle password icon found'
) or print STDERR Dumper( $res->[2]->[0] );
count(2);
ok(
$res = $client->_post(
'/',
IO::String->new('user=dwho&password=dwho'),
length => 23,
),
'Auth query'
);
count(1);
expectOK($res);
my $id = expectCookie($res);
ok(
$res = $client->_get(
'/',
cookie => "lemonldap=$id",
accept => 'text/html'
),
'Get menu'
);
ok(
$res->[2]->[0] =~
m%<i id="toggle_oldpassword" class="fa fa-eye-slash toggle-password">%,
' toggle oldpassword icon found'
) or print STDERR Dumper( $res->[2]->[0] );
ok(
$res->[2]->[0] =~
m%<i id="toggle_newpassword" class="fa fa-eye-slash toggle-password">%,
' toggle newpassword icon found'
) or print STDERR Dumper( $res->[2]->[0] );
ok(
$res->[2]->[0] =~
m%<i id="toggle_confirmpassword" class="fa fa-eye-slash toggle-password">%,
' toggle confirmpassword icon found'
) or print STDERR Dumper( $res->[2]->[0] );
ok(
$res->[2]->[0] =~
m%<input id="newpassword" name="newpassword" type="text" class="form-control"%,
' input type text found'
) or print STDERR Dumper( $res->[2]->[0] );
count(5);
$client->logout($id);
clean_sessions();
done_testing( count() );

View File

@ -328,10 +328,10 @@ m%\Q<span trspan="passwordPolicySpecialChar">Allowed special characters:</span>
' passwordPolicySpecialChar'
) or print STDERR Dumper( $res->[2]->[0], 'passwordPolicySpecialChar' );
ok(
$res->[2]->[0] =~
m%<span id=\'show-hide-icon-button\' class="fa fa-eye"></span>%,
'Show/Hide toogle button'
) or print STDERR Dumper( $res->[2]->[0], 'Toogle button' );
$res->[2]->[0] !~
m%class="fa fa-eye-slash toggle-password">%,
' no toggle icon found'
) or print STDERR Dumper( $res->[2]->[0] );
count(8);
# Test $client->logout

View File

@ -13,7 +13,7 @@ BEGIN {
}
my ( $res, $user, $pwd );
my $maintests = 19;
my $maintests = 22;
my $mailSend = 0;
my $mail2 = 0;
@ -54,6 +54,7 @@ SKIP: {
dbiAuthPasswordHash => '',
dbiDynamicHashEnabled => 0,
dbiMailCol => 'mail',
portalEnablePasswordDisplay => 1,
portalDisplayPasswordPolicy => 1,
passwordPolicyActivation => 0,
passwordResetAllowedRetries => 4,
@ -97,7 +98,23 @@ SKIP: {
# Post mismatched passwords
( $host, $url, $query ) = expectForm( $res, '#', undef, 'token' );
ok( $res->[2]->[0] =~ /newpassword/s, ' Ask for a new password #1' );
ok( $res->[2]->[0] =~ /newpassword/s, ' Ask for a new password #1' )
or print STDERR Dumper( $res->[2]->[0] );
ok(
$res->[2]->[0] =~
m%<i id="toggle_newpassword" class="fa fa-eye-slash toggle-password">%,
' toggle newpassword icon found'
) or print STDERR Dumper( $res->[2]->[0] );
ok(
$res->[2]->[0] =~
m%<i id="toggle_confirmpassword" class="fa fa-eye-slash toggle-password">%,
' toggle confirmpassword icon found'
) or print STDERR Dumper( $res->[2]->[0] );
ok(
$res->[2]->[0] =~
m%<input id="newpassword" name="newpassword" type="password" class="form-control"%,
' input type password found'
) or print STDERR Dumper( $res->[2]->[0] );
$query .= '&newpassword=zz&confirmpassword=z';
ok(
@ -129,7 +146,8 @@ SKIP: {
# Post empty password 2
( $host, $url, $query ) = expectForm( $res, '#', undef, 'token' );
ok( $res->[2]->[0] =~ /newpassword/s, ' Ask for a new password #3' );
ok( $res->[2]->[0] =~ /newpassword/s, ' Ask for a new password #3' )
or print STDERR Dumper( $res->[2]->[0] );
$query .= '&newpassword=zz&confirmpassword=';
ok(