mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-01 20:59:45 +09:00
feat(admin): show and filter users by authentication source (#38900)
This commit is contained in:
@@ -40,8 +40,8 @@ type SearchUserOptions struct {
|
||||
Keyword string
|
||||
Types []UserType
|
||||
UID int64
|
||||
LoginName string // this option should be used only for admin user
|
||||
SourceID int64 // this option should be used only for admin user
|
||||
LoginName string // this option should be used only for admin user
|
||||
SourceID optional.Option[int64] // this option should be used only for admin user, Some(0) means local users
|
||||
OrderBy db.SearchOrderBy
|
||||
Visible []structs.VisibleType
|
||||
Actor *User // The user doing the search
|
||||
@@ -106,8 +106,8 @@ func (opts *SearchUserOptions) toSearchQueryBase(ctx context.Context) db.Session
|
||||
cond = cond.And(builder.Eq{"id": opts.UID})
|
||||
}
|
||||
|
||||
if opts.SourceID > 0 {
|
||||
cond = cond.And(builder.Eq{"login_source": opts.SourceID})
|
||||
if opts.SourceID.Has() {
|
||||
cond = cond.And(builder.Eq{"login_source": opts.SourceID.Value()})
|
||||
}
|
||||
if opts.LoginName != "" {
|
||||
cond = cond.And(builder.Eq{"login_name": opts.LoginName})
|
||||
|
||||
Reference in New Issue
Block a user