mirror of https://github.com/gophish/gophish
Disallow changing of admin username from the UI (#2487)
parent
b7c69662ce
commit
0c255bbe92
File diff suppressed because one or more lines are too long
|
@ -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")
|
||||||
|
|
Loading…
Reference in New Issue