Make it possible to edit a user without necessarily updating the users password (closes #1942)

This commit is contained in:
Bernd Bestel
2022-08-27 14:54:52 +02:00
parent 7e2f30396f
commit 24c9247663
4 changed files with 67 additions and 19 deletions

View File

@@ -120,15 +120,6 @@ $('#user-form input').keydown(function(event)
}
});
if (GetUriParam("changepw") === "true")
{
$('#password').focus();
}
else
{
$('#username').focus();
}
$("#user-picture").on("change", function(e)
{
$("#user-picture-label").removeClass("d-none");
@@ -148,5 +139,25 @@ $("#delete-current-user-picture-button").on("click", function(e)
$("#user-picture-label-none").removeClass("d-none");
});
$("#change_password").click(function()
{
$("#password").attr("disabled", !this.checked);
$("#password_confirm").attr("disabled", !this.checked);
setTimeout(function()
{
$("#password").focus();
}, 200);
});
if (GetUriParam("changepw") === "true")
{
$("#change_password").click();
}
else
{
$('#username').focus();
}
Grocy.Components.UserfieldsForm.Load();
Grocy.FrontendHelpers.ValidateForm('user-form');