mirror of
https://github.com/grocy/grocy.git
synced 2025-08-29 01:14:24 +00:00
Make it possible to edit a user without necessarily updating the users password (closes #1942)
This commit is contained in:
@@ -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');
|
||||
|
Reference in New Issue
Block a user