Add option to use paged LDAP search when synchronizing users (#3895)

This commit is contained in:
Lauris BH 2018-05-05 17:30:47 +03:00 committed by GitHub
parent 7467ff3d94
commit 501fb228e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 59 additions and 2 deletions

View file

@ -91,6 +91,10 @@ func NewAuthSource(ctx *context.Context) {
}
func parseLDAPConfig(form auth.AuthenticationForm) *models.LDAPConfig {
var pageSize uint32
if form.UsePagedSearch {
pageSize = uint32(form.SearchPageSize)
}
return &models.LDAPConfig{
Source: &ldap.Source{
Name: form.Name,
@ -107,6 +111,7 @@ func parseLDAPConfig(form auth.AuthenticationForm) *models.LDAPConfig {
AttributeSurname: form.AttributeSurname,
AttributeMail: form.AttributeMail,
AttributesInBind: form.AttributesInBind,
SearchPageSize: pageSize,
Filter: form.Filter,
AdminFilter: form.AdminFilter,
Enabled: true,