Disallow changing of admin username from the UI (#2487)

pull/2507/head
Glenn Wilkinson 2022-06-01 16:40:04 +01:00
parent b7c69662ce
commit 0c255bbe92
2 changed files with 5 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -56,6 +56,7 @@ const dismiss = () => {
} }
const edit = (id) => { const edit = (id) => {
$("#username").attr("disabled", false);
$("#modalSubmit").unbind('click').click(() => { $("#modalSubmit").unbind('click').click(() => {
save(id) save(id)
}) })
@ -73,6 +74,9 @@ const edit = (id) => {
$("#role").trigger("change") $("#role").trigger("change")
$("#force_password_change_checkbox").prop('checked', user.password_change_required) $("#force_password_change_checkbox").prop('checked', user.password_change_required)
$("#account_locked_checkbox").prop('checked', user.account_locked) $("#account_locked_checkbox").prop('checked', user.account_locked)
if (user.username == "admin") {
$("#username").attr("disabled", true);
}
}) })
.error(function () { .error(function () {
errorFlash("Error fetching user") errorFlash("Error fetching user")