summaryrefslogtreecommitdiffstats
path: root/modules/context/pagination.go
diff options
context:
space:
mode:
authorOtto Richter (fnetX) <git@fralix.ovh>2022-03-01 20:21:37 +0100
committerGitHub <noreply@github.com>2022-03-01 20:21:37 +0100
commitaee0fa68a71f03b65460597af3f37a3f4c4a04dc (patch)
treefc4096620d7ace4e8466cae4efb44e2e8eac2146 /modules/context/pagination.go
parent062fd4c217cc7302f56acf043d6214a9db46ee2f (diff)
downloadgitea-aee0fa68a71f03b65460597af3f37a3f4c4a04dc.tar.gz
gitea-aee0fa68a71f03b65460597af3f37a3f4c4a04dc.zip
Fix admin user list pagination (#18957)
Diffstat (limited to 'modules/context/pagination.go')
-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]"))
+}