Allow to display password value in login form (#2454)
This commit is contained in:
parent
dae4293ecf
commit
bdeb1e70d9
|
@ -396,6 +396,7 @@ sub display {
|
||||||
? ( CUSTOM_SCRIPT => $req->data->{customScript} )
|
? ( CUSTOM_SCRIPT => $req->data->{customScript} )
|
||||||
: ()
|
: ()
|
||||||
),
|
),
|
||||||
|
ENABLE_PASSWORD_DISPLAY => $self->conf->{portalEnablePasswordDisplay},
|
||||||
);
|
);
|
||||||
|
|
||||||
# Display captcha if it's enabled
|
# Display captcha if it's enabled
|
||||||
|
|
|
@ -515,6 +515,14 @@ $(window).on 'load', () ->
|
||||||
if window.datas.ppolicy? and $('#newpassword').length
|
if window.datas.ppolicy? and $('#newpassword').length
|
||||||
$('#reset').change togglecheckpassword
|
$('#reset').change togglecheckpassword
|
||||||
|
|
||||||
|
if datas['enablePasswordDisplay']
|
||||||
|
$(".toggle-password").mousedown (e) ->
|
||||||
|
$(this).toggleClass("fa-eye fa-eye-slash");
|
||||||
|
$("input[name=password]").attr("type", "text");
|
||||||
|
$(".toggle-password").mouseup (e) ->
|
||||||
|
$(this).toggleClass("fa-eye fa-eye-slash");
|
||||||
|
$("input[name=password]").attr("type", "password");
|
||||||
|
|
||||||
# Ping if asked
|
# Ping if asked
|
||||||
if datas['pingInterval'] and datas['pingInterval'] > 0
|
if datas['pingInterval'] and datas['pingInterval'] > 0
|
||||||
window.setTimeout ping, datas['pingInterval']
|
window.setTimeout ping, datas['pingInterval']
|
||||||
|
|
|
@ -561,6 +561,16 @@ LemonLDAP::NG Portal jQuery scripts
|
||||||
if ((window.datas.ppolicy != null) && $('#newpassword').length) {
|
if ((window.datas.ppolicy != null) && $('#newpassword').length) {
|
||||||
$('#reset').change(togglecheckpassword);
|
$('#reset').change(togglecheckpassword);
|
||||||
}
|
}
|
||||||
|
if (datas['enablePasswordDisplay']) {
|
||||||
|
$(".toggle-password").mousedown(function(e) {
|
||||||
|
$(this).toggleClass("fa-eye fa-eye-slash");
|
||||||
|
return $("input[name=password]").attr("type", "text");
|
||||||
|
});
|
||||||
|
$(".toggle-password").mouseup(function(e) {
|
||||||
|
$(this).toggleClass("fa-eye fa-eye-slash");
|
||||||
|
return $("input[name=password]").attr("type", "password");
|
||||||
|
});
|
||||||
|
}
|
||||||
if (datas['pingInterval'] && datas['pingInterval'] > 0) {
|
if (datas['pingInterval'] && datas['pingInterval'] > 0) {
|
||||||
window.setTimeout(ping, datas['pingInterval']);
|
window.setTimeout(ping, datas['pingInterval']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,11 @@
|
||||||
<input id="passwordfield" name="password" type="text" class="form-control key" autocomplete="off" required aria-required="true" aria-hidden="true"/>
|
<input id="passwordfield" name="password" type="text" class="form-control key" autocomplete="off" required aria-required="true" aria-hidden="true"/>
|
||||||
<TMPL_ELSE>
|
<TMPL_ELSE>
|
||||||
<input id="passwordfield" name="password" type="password" class="form-control" trplaceholder="password" required aria-required="true"/>
|
<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>
|
||||||
|
</div>
|
||||||
|
</TMPL_IF>
|
||||||
</TMPL_IF>
|
</TMPL_IF>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
"scriptname":"<TMPL_VAR NAME="SCRIPT_NAME">",
|
"scriptname":"<TMPL_VAR NAME="SCRIPT_NAME">",
|
||||||
"activeTimer":<TMPL_VAR NAME="ACTIVE_TIMER" DEFAULT="0">,
|
"activeTimer":<TMPL_VAR NAME="ACTIVE_TIMER" DEFAULT="0">,
|
||||||
"pingInterval":<TMPL_VAR NAME="PING" DEFAULT="0">,
|
"pingInterval":<TMPL_VAR NAME="PING" DEFAULT="0">,
|
||||||
"trOver":<TMPL_VAR NAME="TROVER" DEFAULT="[]"><TMPL_IF NAME="DISPLAY_PPOLICY">,
|
"trOver":<TMPL_VAR NAME="TROVER" DEFAULT="[]">,<TMPL_IF NAME="DISPLAY_PPOLICY">
|
||||||
"ppolicy": {
|
"ppolicy": {
|
||||||
"display": "<TMPL_VAR NAME="DISPLAY_PPOLICY" DEFAULT="0">",
|
"display": "<TMPL_VAR NAME="DISPLAY_PPOLICY" DEFAULT="0">",
|
||||||
"minsize": "<TMPL_VAR NAME="PPOLICY_MINSIZE" DEFAULT="0">",
|
"minsize": "<TMPL_VAR NAME="PPOLICY_MINSIZE" DEFAULT="0">",
|
||||||
|
@ -36,7 +36,8 @@
|
||||||
"nopolicy": "<TMPL_VAR NAME="PPOLICY_NOPOLICY" DEFAULT="0">",
|
"nopolicy": "<TMPL_VAR NAME="PPOLICY_NOPOLICY" DEFAULT="0">",
|
||||||
"allowedspechar": "<TMPL_VAR NAME="PPOLICY_ALLOWEDSPECHAR" ESCAPE="js" DEFAULT="">",
|
"allowedspechar": "<TMPL_VAR NAME="PPOLICY_ALLOWEDSPECHAR" ESCAPE="js" DEFAULT="">",
|
||||||
"minspechar": "<TMPL_VAR NAME="PPOLICY_MINSPECHAR" DEFAULT="0">"
|
"minspechar": "<TMPL_VAR NAME="PPOLICY_MINSPECHAR" DEFAULT="0">"
|
||||||
}</TMPL_IF>
|
},</TMPL_IF>
|
||||||
|
"enablePasswordDisplay":<TMPL_VAR NAME="ENABLE_PASSWORD_DISPLAY" DEFAULT="0">
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user