Skip to content

Commit 6ef197e

Browse files
committed
refactor
1 parent de1fd67 commit 6ef197e

File tree

13 files changed

+80
-133
lines changed

13 files changed

+80
-133
lines changed

cmd/admin_auth_ldap.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,6 @@ var (
9898
Name: "avatar-attribute",
9999
Usage: "The attribute of the user’s LDAP record containing the user’s avatar.",
100100
},
101-
cli.StringFlag{
102-
Name: "team-group-map",
103-
Usage: "Map of LDAP groups to teams.",
104-
},
105-
cli.BoolFlag{
106-
Name: "team-group-map-removal",
107-
Usage: "Force synchronization of mapped LDAP groups to teams.",
108-
},
109101
}
110102

111103
ldapBindDnCLIFlags = append(commonLdapCLIFlags,
@@ -268,14 +260,6 @@ func parseLdapConfig(c *cli.Context, config *ldap.Source) error {
268260
if c.IsSet("skip-local-2fa") {
269261
config.SkipLocalTwoFA = c.Bool("skip-local-2fa")
270262
}
271-
if c.IsSet("team-group-map") {
272-
config.TeamGroupMapEnabled = c.Bool("team-group-map")
273-
config.TeamGroupMap = c.String("team-group-map")
274-
}
275-
if c.IsSet("team-group-map-removal") {
276-
config.TeamGroupMapRemoval = c.Bool("team-group-map-removal")
277-
}
278-
279263
return nil
280264
}
281265

integrations/auth_ldap_test.go

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,11 @@ func getLDAPServerHost() string {
101101
}
102102

103103
func addAuthSourceLDAP(t *testing.T, sshKeyAttribute string, groupMapParams ...string) {
104-
teamGroupMapEnabled := "off"
105-
teamGroupMapRemoval := "off"
106-
teamGroupMap := ""
107-
if len(groupMapParams) == 3 {
108-
teamGroupMapEnabled = groupMapParams[0]
109-
teamGroupMapRemoval = groupMapParams[1]
110-
teamGroupMap = groupMapParams[2]
104+
groupTeamMapRemoval := "off"
105+
groupTeamMap := ""
106+
if len(groupMapParams) == 2 {
107+
groupTeamMapRemoval = groupMapParams[0]
108+
groupTeamMap = groupMapParams[1]
111109
}
112110
session := loginUser(t, "user1")
113111
csrf := GetCSRF(t, session, "/admin/auths/new")
@@ -130,12 +128,11 @@ func addAuthSourceLDAP(t *testing.T, sshKeyAttribute string, groupMapParams ...s
130128
"attribute_ssh_public_key": sshKeyAttribute,
131129
"is_sync_enabled": "on",
132130
"is_active": "on",
133-
"team_group_map_enabled": teamGroupMapEnabled,
134-
"team_group_map_removal": teamGroupMapRemoval,
135131
"group_dn": "ou=people,dc=planetexpress,dc=com",
136132
"group_member_uid": "member",
133+
"group_team_map": groupTeamMap,
134+
"group_team_map_removal": groupTeamMapRemoval,
137135
"user_uid": "DN",
138-
"team_group_map": teamGroupMap,
139136
})
140137
session.MakeRequest(t, req, http.StatusFound)
141138
}
@@ -318,7 +315,7 @@ func TestLDAPGroupTeamSyncAddMember(t *testing.T) {
318315
return
319316
}
320317
defer prepareTestEnv(t)()
321-
addAuthSourceLDAP(t, "", "on", "on", "{\"cn=ship_crew,ou=people,dc=planetexpress,dc=com\":{\"org26\": [\"team11\"]},\"cn=admin_staff,ou=people,dc=planetexpress,dc=com\": {\"non-existent\": [\"non-existent\"]}}")
318+
addAuthSourceLDAP(t, "", "on", `{"cn=ship_crew,ou=people,dc=planetexpress,dc=com":{"org26": ["team11"]},"cn=admin_staff,ou=people,dc=planetexpress,dc=com": {"non-existent": ["non-existent"]}}`)
322319
org, err := models.GetOrgByName("org26")
323320
assert.NoError(t, err)
324321
team, err := models.GetTeam(org.ID, "team11")
@@ -363,7 +360,7 @@ func TestLDAPGroupTeamSyncRemoveMember(t *testing.T) {
363360
return
364361
}
365362
defer prepareTestEnv(t)()
366-
addAuthSourceLDAP(t, "", "on", "on", "{\"cn=dispatch,ou=people,dc=planetexpress,dc=com\": {\"org26\": [\"team11\"]}}")
363+
addAuthSourceLDAP(t, "", "on", `{"cn=dispatch,ou=people,dc=planetexpress,dc=com": {"org26": ["team11"]}}`)
367364
org, err := models.GetOrgByName("org26")
368365
assert.NoError(t, err)
369366
team, err := models.GetTeam(org.ID, "team11")
@@ -399,7 +396,7 @@ func TestBrokenLDAPMapUserSignin(t *testing.T) {
399396
return
400397
}
401398
defer prepareTestEnv(t)()
402-
addAuthSourceLDAP(t, "", "on", "on", "{\"NOT_A_VALID_JSON\"[\"MISSING_DOUBLE_POINT\"]}")
399+
addAuthSourceLDAP(t, "", "on", `{"NOT_A_VALID_JSON"["MISSING_DOUBLE_POINT"]}`)
403400

404401
u := gitLDAPUsers[0]
405402

options/locale/locale_en-US.ini

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2561,14 +2561,13 @@ auths.filter = User Filter
25612561
auths.admin_filter = Admin Filter
25622562
auths.restricted_filter = Restricted Filter
25632563
auths.restricted_filter_helper = Leave empty to not set any users as restricted. Use an asterisk ('*') to set all users that do not match Admin Filter as restricted.
2564-
auths.verify_group_membership = Verify group membership in LDAP
2564+
auths.verify_group_membership = Verify group membership in LDAP (leave the filter empty to skip)
25652565
auths.group_search_base = Group Search Base DN
2566-
auths.valid_groups_filter = Valid Groups Filter
25672566
auths.group_attribute_list_users = Group Attribute Containing List Of Users
25682567
auths.user_attribute_in_group = User Attribute Listed In Group
2569-
auths.team_group_map = Map LDAP groups to Organization teams
2570-
auths.team_group_map_removal = Remove users from synchronized teams if user does not belong to corresponding LDAP group
2571-
auths.team_group_map_enabled = Enable mapping LDAP groups to gitea organizations teams
2568+
auths.map_group_to_team = Map LDAP groups to Organization teams (leave the filter empty to skip)
2569+
auths.map_group_to_team_removal = Remove users from synchronized teams if user does not belong to corresponding LDAP group
2570+
auths.enable_ldap_groups = Enable LDAP groups
25722571
auths.ms_ad_sa = MS AD Search Attributes
25732572
auths.smtp_auth = SMTP Authentication Type
25742573
auths.smtphost = SMTP Host

routers/web/admin/auths.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,12 @@ func parseLDAPConfig(form forms.AuthenticationForm) *ldap.Source {
145145
GroupDN: form.GroupDN,
146146
GroupFilter: form.GroupFilter,
147147
GroupMemberUID: form.GroupMemberUID,
148+
GroupTeamMap: form.GroupTeamMap,
149+
GroupTeamMapRemoval: form.GroupTeamMapRemoval,
148150
UserUID: form.UserUID,
149151
AdminFilter: form.AdminFilter,
150152
RestrictedFilter: form.RestrictedFilter,
151153
AllowDeactivateAll: form.AllowDeactivateAll,
152-
TeamGroupMap: form.TeamGroupMap,
153-
TeamGroupMapRemoval: form.TeamGroupMapRemoval,
154-
TeamGroupMapEnabled: form.TeamGroupMapEnabled,
155154
Enabled: true,
156155
SkipLocalTwoFA: form.SkipLocalTwoFA,
157156
}

services/auth/source/ldap/source.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,10 @@ type Source struct {
5252
GroupDN string // Group Search Base
5353
GroupFilter string // Group Name Filter
5454
GroupMemberUID string // Group Attribute containing array of UserUID
55+
GroupTeamMap string // Map LDAP groups to teams
56+
GroupTeamMapRemoval bool // Remove user from teams which are synchronized and user is not a member of the corresponding LDAP group
5557
UserUID string // User Attribute listed in Group
5658
SkipLocalTwoFA bool `json:",omitempty"` // Skip Local 2fa for users authenticated with this source
57-
TeamGroupMap string // Map LDAP groups to teams
58-
TeamGroupMapRemoval bool // Remove user from teams which are synchronized and user is not a member of the corresponding LDAP group
59-
TeamGroupMapEnabled bool // if LDAP groups mapping to gitea organizations teams is enabled
6059

6160
// reference to the authSource
6261
authSource *auth.Source

services/auth/source/ldap/source_authenticate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func (source *Source) Authenticate(user *user_model.User, userName, password str
6060
}
6161

6262
if user != nil {
63-
if source.TeamGroupMapEnabled || source.TeamGroupMapRemoval {
63+
if source.GroupsEnabled && (source.GroupTeamMap != "" || source.GroupTeamMapRemoval) {
6464
orgCache := make(map[string]*models.Organization)
6565
teamCache := make(map[string]*models.Team)
6666
source.SyncLdapGroupsToTeams(user, sr.LdapTeamAdd, sr.LdapTeamRemove, orgCache, teamCache)
@@ -106,7 +106,7 @@ func (source *Source) Authenticate(user *user_model.User, userName, password str
106106
if err == nil && len(source.AttributeAvatar) > 0 {
107107
_ = user_service.UploadAvatar(user, sr.Avatar)
108108
}
109-
if source.TeamGroupMapEnabled || source.TeamGroupMapRemoval {
109+
if source.GroupsEnabled && (source.GroupTeamMap != "" || source.GroupTeamMapRemoval) {
110110
orgCache := make(map[string]*models.Organization)
111111
teamCache := make(map[string]*models.Team)
112112
source.SyncLdapGroupsToTeams(user, sr.LdapTeamAdd, sr.LdapTeamRemove, orgCache, teamCache)

services/auth/source/ldap/source_group_sync.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
// SyncLdapGroupsToTeams maps LDAP groups to organization and team memberships
1414
func (source *Source) SyncLdapGroupsToTeams(user *user_model.User, ldapTeamAdd, ldapTeamRemove map[string][]string, orgCache map[string]*models.Organization, teamCache map[string]*models.Team) {
1515
var err error
16-
if source.TeamGroupMapRemoval {
16+
if source.GroupsEnabled && source.GroupTeamMapRemoval {
1717
// when the user is not a member of configs LDAP group, remove mapped organizations/teams memberships
1818
removeMappedMemberships(user, ldapTeamRemove, orgCache, teamCache)
1919
}

services/auth/source/ldap/source_search.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ func (ls *Source) listLdapGroupMemberships(l *ldap.Conn, uid string) []string {
230230
// parse LDAP groups and return map of ldap groups to organizations teams
231231
func (ls *Source) mapLdapGroupsToTeams() map[string]map[string][]string {
232232
ldapGroupsToTeams := make(map[string]map[string][]string)
233-
err := json.Unmarshal([]byte(ls.TeamGroupMap), &ldapGroupsToTeams)
233+
err := json.Unmarshal([]byte(ls.GroupTeamMap), &ldapGroupsToTeams)
234234
if err != nil {
235235
log.Error("Failed to unmarshall LDAP teams map: %v", err)
236236
return ldapGroupsToTeams
@@ -447,7 +447,7 @@ func (ls *Source) SearchEntry(name, passwd string, directBind bool) *SearchResul
447447

448448
teamsToAdd := make(map[string][]string)
449449
teamsToRemove := make(map[string][]string)
450-
if ls.TeamGroupMapEnabled || ls.TeamGroupMapRemoval {
450+
if ls.GroupsEnabled && (ls.GroupTeamMap != "" || ls.GroupTeamMapRemoval) {
451451
teamsToAdd, teamsToRemove = ls.getMappedMemberships(l, uid)
452452
}
453453

@@ -526,7 +526,7 @@ func (ls *Source) SearchEntries() ([]*SearchResult, error) {
526526
for i, v := range sr.Entries {
527527
teamsToAdd := make(map[string][]string)
528528
teamsToRemove := make(map[string][]string)
529-
if ls.TeamGroupMapEnabled || ls.TeamGroupMapRemoval {
529+
if ls.GroupsEnabled && (ls.GroupTeamMap != "" || ls.GroupTeamMapRemoval) {
530530
userAttributeListedInGroup := v.GetAttributeValue(ls.UserUID)
531531
if ls.UserUID == "dn" || ls.UserUID == "DN" {
532532
userAttributeListedInGroup = v.DN

services/auth/source/ldap/source_sync.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func (source *Source) Sync(ctx context.Context, updateExisting bool) error {
170170
}
171171
}
172172
// Synchronize LDAP groups with organization and team memberships
173-
if source.TeamGroupMapEnabled || source.TeamGroupMapRemoval {
173+
if source.GroupsEnabled && (source.GroupTeamMap != "" || source.GroupTeamMapRemoval) {
174174
source.SyncLdapGroupsToTeams(usr, su.LdapTeamAdd, su.LdapTeamRemove, orgCache, teamCache)
175175
}
176176
}

services/forms/auth_form.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,8 @@ type AuthenticationForm struct {
7979
SSPIStripDomainNames bool
8080
SSPISeparatorReplacement string `binding:"AlphaDashDot;MaxSize(5)"`
8181
SSPIDefaultLanguage string
82-
TeamGroupMap string
83-
TeamGroupMapRemoval bool
84-
TeamGroupMapEnabled bool
82+
GroupTeamMap string
83+
GroupTeamMapRemoval bool
8584
}
8685

8786
// Validate validates fields

templates/admin/auth/edit.tmpl

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -108,47 +108,43 @@
108108
<label for="attribute_avatar">{{.i18n.Tr "admin.auths.attribute_avatar"}}</label>
109109
<input id="attribute_avatar" name="attribute_avatar" value="{{$cfg.AttributeAvatar}}" placeholder="e.g. jpegPhoto">
110110
</div>
111+
112+
113+
<!-- ldap group begin -->
111114
<div class="inline field">
112115
<div class="ui checkbox">
113-
<label for="team_group_map_enabled"><strong>{{.i18n.Tr "admin.auths.team_group_map_enabled"}}</strong></label>
114-
<input id="team_group_map_enabled" name="team_group_map_enabled" type="checkbox" class="ldap-group-options" {{if $cfg.TeamGroupMapEnabled}}checked{{end}}>
116+
<label><strong>{{.i18n.Tr "admin.auths.enable_ldap_groups"}}</strong></label>
117+
<input type="checkbox" name="groups_enabled" class="js-ldap-group-toggle" {{if $cfg.GroupsEnabled}}checked{{end}}>
115118
</div>
116119
</div>
117-
<div class="inline field">
118-
<div class="ui checkbox">
119-
<label for="team_group_map_removal"><strong>{{.i18n.Tr "admin.auths.team_group_map_removal"}}</strong></label>
120-
<input id="team_group_map_removal" name="team_group_map_removal" type="checkbox" class="ldap-group-options" {{if $cfg.TeamGroupMapRemoval}}checked{{end}}>
120+
<div id="ldap-group-options" class="ui segment secondary" {{if not $cfg.GroupsEnabled}}hidden{{end}}>
121+
<div class="field">
122+
<label>{{.i18n.Tr "admin.auths.group_search_base"}}</label>
123+
<input name="group_dn" value="{{$cfg.GroupDN}}" placeholder="e.g. ou=group,dc=mydomain,dc=com">
121124
</div>
122-
</div>
123-
<div class="inline field">
124-
<div class="ui checkbox">
125-
<label for="groups_enabled"><strong>{{.i18n.Tr "admin.auths.verify_group_membership"}}</strong></label>
126-
<input id="groups_enabled" name="groups_enabled" type="checkbox" class="ldap-group-options" {{if $cfg.GroupsEnabled}}checked{{end}}>
125+
<div class="field">
126+
<label>{{.i18n.Tr "admin.auths.group_attribute_list_users"}}</label>
127+
<input name="group_member_uid" value="{{$cfg.GroupMemberUID}}" placeholder="e.g. memberUid">
127128
</div>
128-
</div>
129-
<div id="groups_enabled_change">
130129
<div class="field">
131-
<label for="group_dn">{{.i18n.Tr "admin.auths.group_search_base"}}</label>
132-
<input id="group_dn" name="group_dn" value="{{$cfg.GroupDN}}" placeholder="e.g. ou=group,dc=mydomain,dc=com">
130+
<label>{{.i18n.Tr "admin.auths.user_attribute_in_group"}}</label>
131+
<input name="user_uid" value="{{$cfg.UserUID}}" placeholder="e.g. uid">
133132
</div>
134133
<div class="field">
135-
<label for="group_member_uid">{{.i18n.Tr "admin.auths.group_attribute_list_users"}}</label>
136-
<input id="group_member_uid" name="group_member_uid" value="{{$cfg.GroupMemberUID}}" placeholder="e.g. memberUid">
134+
<label>{{.i18n.Tr "admin.auths.verify_group_membership"}}</label>
135+
<input name="group_filter" value="{{$cfg.GroupFilter}}" placeholder="e.g. (|(cn=gitea_users)(cn=admins))">
137136
</div>
138137
<div class="field">
139-
<label for="user_uid">{{.i18n.Tr "admin.auths.user_attribute_in_group"}}</label>
140-
<input id="user_uid" name="user_uid" value="{{$cfg.UserUID}}" placeholder="e.g. uid">
138+
<label>{{.i18n.Tr "admin.auths.map_group_to_team"}}</label>
139+
<input name="group_team_map" value="{{$cfg.GroupTeamMap}}" placeholder='e.g. {"cn=my-group,cn=groups,dc=example,dc=org": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>
140+
</div>
141+
<div class="ui checkbox">
142+
<label>{{.i18n.Tr "admin.auths.map_group_to_team_removal"}}</label>
143+
<input name="group_team_map_removal" type="checkbox" {{if $cfg.GroupTeamMapRemoval}}checked{{end}}>
141144
</div>
142-
<br/>
143-
</div>
144-
<div id="group_filter_field" class="field">
145-
<label for="group_filter">{{.i18n.Tr "admin.auths.valid_groups_filter"}}</label>
146-
<input id="group_filter" name="group_filter" value="{{$cfg.GroupFilter}}" placeholder="e.g. (|(cn=gitea_users)(cn=admins))">
147-
</div>
148-
<div id="team_group_map_field" class="field">
149-
<label for="team_group_map">{{.i18n.Tr "admin.auths.team_group_map"}}</label>
150-
<input id="team_group_map" name="team_group_map" value="{{$cfg.TeamGroupMap}}" placeholder='e.g. {"cn=MyGroup,cn=groups,dc=example,dc=org": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>
151145
</div>
146+
<!-- ldap group end -->
147+
152148
{{if .Source.IsLDAP}}
153149
<div class="inline field">
154150
<div class="ui checkbox">

templates/admin/auth/source/ldap.tmpl

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -79,47 +79,42 @@
7979
<label for="attribute_avatar">{{.i18n.Tr "admin.auths.attribute_avatar"}}</label>
8080
<input id="attribute_avatar" name="attribute_avatar" value="{{.attribute_avatar}}" placeholder="e.g. jpegPhoto">
8181
</div>
82+
83+
<!-- ldap group begin -->
8284
<div class="inline field">
8385
<div class="ui checkbox">
84-
<label for="team_group_map_enabled"><strong>{{.i18n.Tr "admin.auths.team_group_map_enabled"}}</strong></label>
85-
<input id="team_group_map_enabled" name="team_group_map_enabled" type="checkbox" class="ldap-group-options" {{if .team_group_map_enabled}}checked{{end}}>
86+
<label><strong>{{.i18n.Tr "admin.auths.enable_ldap_groups"}}</strong></label>
87+
<input type="checkbox" name="groups_enabled" class="js-ldap-group-toggle" {{if .groups_enabled}}checked{{end}}>
8688
</div>
8789
</div>
88-
<div class="inline field">
89-
<div class="ui checkbox">
90-
<label for="team_group_map_removal"><strong>{{.i18n.Tr "admin.auths.team_group_map_removal"}}</strong></label>
91-
<input id="team_group_map_removal" name="team_group_map_removal" type="checkbox" class="ldap-group-options" {{if .team_group_map_removal}}checked{{end}}>
90+
<div id="ldap-group-options" class="ui segment secondary">
91+
<div class="field">
92+
<label>{{.i18n.Tr "admin.auths.group_search_base"}}</label>
93+
<input name="group_dn" value="{{.group_dn}}" placeholder="e.g. ou=group,dc=mydomain,dc=com">
9294
</div>
93-
</div>
94-
<div class="inline field">
95-
<div class="ui checkbox">
96-
<label for="groups_enabled"><strong>{{.i18n.Tr "admin.auths.verify_group_membership"}}</strong></label>
97-
<input id="groups_enabled" name="groups_enabled" type="checkbox" class="ldap-group-options" {{if .groups_enabled}}checked{{end}}>
95+
<div class="field">
96+
<label>{{.i18n.Tr "admin.auths.group_attribute_list_users"}}</label>
97+
<input name="group_member_uid" value="{{.group_member_uid}}" placeholder="e.g. memberUid">
9898
</div>
99-
</div>
100-
<div id="groups_enabled_change">
10199
<div class="field">
102-
<label for="group_dn">{{.i18n.Tr "admin.auths.group_search_base"}}</label>
103-
<input id="group_dn" name="group_dn" value="{{.group_dn}}" placeholder="e.g. ou=group,dc=mydomain,dc=com">
100+
<label>{{.i18n.Tr "admin.auths.user_attribute_in_group"}}</label>
101+
<input name="user_uid" value="{{.user_uid}}" placeholder="e.g. uid">
104102
</div>
105103
<div class="field">
106-
<label for="group_member_uid">{{.i18n.Tr "admin.auths.group_attribute_list_users"}}</label>
107-
<input id="group_member_uid" name="group_member_uid" value="{{.group_member_uid}}" placeholder="e.g. memberUid">
104+
<label>{{.i18n.Tr "admin.auths.verify_group_membership"}}</label>
105+
<input name="group_filter" value="{{.group_filter}}" placeholder="e.g. (|(cn=gitea_users)(cn=admins))">
108106
</div>
109107
<div class="field">
110-
<label for="user_uid">{{.i18n.Tr "admin.auths.user_attribute_in_group"}}</label>
111-
<input id="user_uid" name="user_uid" value="{{.user_uid}}" placeholder="e.g. uid">
108+
<label>{{.i18n.Tr "admin.auths.map_group_to_team"}}</label>
109+
<input name="group_team_map" value="{{.group_team_map}}" placeholder='e.g. {"cn=my-group,cn=groups,dc=example,dc=org": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>
110+
</div>
111+
<div class="ui checkbox">
112+
<label>{{.i18n.Tr "admin.auths.map_group_to_team_removal"}}</label>
113+
<input name="group_team_map_removal" type="checkbox" {{if .group_team_map_removal}}checked{{end}}>
112114
</div>
113-
<br/>
114-
</div>
115-
<div id="group_filter_field" class="field">
116-
<label for="group_filter">{{.i18n.Tr "admin.auths.valid_groups_filter"}}</label>
117-
<input id="group_filter" name="group_filter" value="{{.group_filter}}" placeholder="e.g. (|(cn=gitea_users)(cn=admins))">
118-
</div>
119-
<div id="team_group_map_field" class="field">
120-
<label for="team_group_map">{{.i18n.Tr "admin.auths.team_group_map"}}</label>
121-
<input id="team_group_map" name="team_group_map" value="{{.team_group_map}}" placeholder='e.g. {"cn=MyGroup,cn=groups,dc=example,dc=org": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>
122115
</div>
116+
<!-- ldap group end -->
117+
123118
<div class="ldap inline field {{if not (eq .type 2)}}hide{{end}}">
124119
<div class="ui checkbox">
125120
<label for="use_paged_search"><strong>{{.i18n.Tr "admin.auths.use_paged_search"}}</strong></label>

0 commit comments

Comments
 (0)