|
|
|
@ -41,10 +41,16 @@ func Users(ctx *context.Context) { |
|
|
|
|
ctx.Data["PageIsAdmin"] = true |
|
|
|
|
ctx.Data["PageIsAdminUsers"] = true |
|
|
|
|
|
|
|
|
|
extraParamStrings := map[string]string{} |
|
|
|
|
statusFilterKeys := []string{"is_active", "is_admin", "is_restricted", "is_2fa_enabled", "is_prohibit_login"} |
|
|
|
|
statusFilterMap := map[string]string{} |
|
|
|
|
for _, filterKey := range statusFilterKeys { |
|
|
|
|
statusFilterMap[filterKey] = ctx.FormString("status_filter[" + filterKey + "]") |
|
|
|
|
paramKey := "status_filter[" + filterKey + "]" |
|
|
|
|
paramVal := ctx.FormString(paramKey) |
|
|
|
|
statusFilterMap[filterKey] = paramVal |
|
|
|
|
if paramVal != "" { |
|
|
|
|
extraParamStrings[paramKey] = paramVal |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
sortType := ctx.FormString("sort") |
|
|
|
@ -68,6 +74,7 @@ func Users(ctx *context.Context) { |
|
|
|
|
IsRestricted: util.OptionalBoolParse(statusFilterMap["is_restricted"]), |
|
|
|
|
IsTwoFactorEnabled: util.OptionalBoolParse(statusFilterMap["is_2fa_enabled"]), |
|
|
|
|
IsProhibitLogin: util.OptionalBoolParse(statusFilterMap["is_prohibit_login"]), |
|
|
|
|
ExtraParamStrings: extraParamStrings, |
|
|
|
|
}, tplUsers) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|