fixed bug in dialog validation for sysadmin edit user
This commit is contained in:
+1
-1
@@ -307,12 +307,12 @@ func UserManagementSave(ctxt ui.AmContext) (string, any) {
|
|||||||
|
|
||||||
dlg, err := ui.AmLoadDialog("admin_user")
|
dlg, err := ui.AmLoadDialog("admin_user")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
dlg.LoadFromForm(ctxt)
|
|
||||||
dlg.SetTargetUser(user)
|
dlg.SetTargetUser(user)
|
||||||
if ctxt.CurrentUser().BaseLevel == database.AmRole("Global.BOFH").Level() {
|
if ctxt.CurrentUser().BaseLevel == database.AmRole("Global.BOFH").Level() {
|
||||||
// only the BOFH can designate a user as a PFY!
|
// only the BOFH can designate a user as a PFY!
|
||||||
dlg.Field("base_lvl").Param = "Global.UserLevelsPFY"
|
dlg.Field("base_lvl").Param = "Global.UserLevelsPFY"
|
||||||
}
|
}
|
||||||
|
dlg.LoadFromForm(ctxt)
|
||||||
action := dlg.WhichButton(ctxt)
|
action := dlg.WhichButton(ctxt)
|
||||||
if action == "cancel" { // Cancel button pressed
|
if action == "cancel" { // Cancel button pressed
|
||||||
return "redirect", "/sysadmin/users"
|
return "redirect", "/sysadmin/users"
|
||||||
|
|||||||
Reference in New Issue
Block a user