summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/context/pagination.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/context/pagination.go b/modules/context/pagination.go
index 107cbf6186..140b676786 100644
--- a/modules/context/pagination.go
+++ b/modules/context/pagination.go
@@ -55,3 +55,12 @@ func (p *Pagination) SetDefaultParams(ctx *Context) {
p.AddParam(ctx, "tab", "TabName")
p.AddParam(ctx, "t", "queryType")
}
+
+// SetUserFilterParams sets common pagination params for user filtering, e.g. the admin userlist
+func (p *Pagination) SetUserFilterParams(ctx *Context) {
+ p.AddParamString("status_filter[is_active]", ctx.FormString("status_filter[is_active]"))
+ p.AddParamString("status_filter[is_admin]", ctx.FormString("status_filter[is_admin]"))
+ p.AddParamString("status_filter[is_restricted]", ctx.FormString("status_filter[is_restricted]"))
+ p.AddParamString("status_filter[is_2fa_enabled]", ctx.FormString("status_filter[is_2fa_enabled]"))
+ p.AddParamString("status_filter[is_prohibit_login]", ctx.FormString("status_filter[is_prohibit_login]"))
+}