Suppress default password warning (#830)

This commit is contained in:
LordGrey
2020-06-26 18:16:59 +02:00
committed by GitHub
parent 5eb45e857f
commit 1744f6d07a
3 changed files with 17 additions and 2 deletions

View File

@@ -152,8 +152,13 @@ $(document).ready(function () {
$("#main-nav").removeAttr('style')
$("#top-navbar").removeAttr('style')
if (window.defaultPasswordIsSet === true)
showNotification('warning', $.i18n('dashboard_message_default_password'), $.i18n('dashboard_message_default_password_t'), '<a style="cursor:pointer" onClick="changePassword()"> ' + $.i18n('InfoDialog_changePassword_title') + '</a>')
if (window.defaultPasswordIsSet === true && getStorage("suppressDefaultPwWarning") !== "true" )
{
var supprPwWarnCheckbox = '<div class="text-right">'+$.i18n('dashboard_message_do_not_show_again')
+ ' <input id="chk_suppressDefaultPw" type="checkbox" onChange="suppressDefaultPwWarning()"> </div>'
showNotification('warning', $.i18n('dashboard_message_default_password'), $.i18n('dashboard_message_default_password_t'), '<a style="cursor:pointer" onClick="changePassword()">'
+ $.i18n('InfoDialog_changePassword_title') + '</a>' + supprPwWarnCheckbox)
}
else
//if logged on and pw != default show option to lock ui
$("#btn_lock_ui").removeAttr('style')
@@ -308,6 +313,14 @@ $(document).ready(function () {
});
function suppressDefaultPwWarning(){
if (document.getElementById('chk_suppressDefaultPw').checked)
setStorage("suppressDefaultPwWarning", "true");
else
setStorage("suppressDefaultPwWarning", "false");
}
$(function () {
var sidebar = $('#side-menu'); // cache sidebar to a variable for performance
sidebar.delegate('a.inactive', 'click', function () {