From 5dfa4fb62979ab9d4eba3c33a29397fe10f7cbc3 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Mon, 4 Jul 2016 07:04:02 -0400 Subject: Adding page size option to LDAP (#3439) --- model/config.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'model') diff --git a/model/config.go b/model/config.go index 1d9e078b6..e71a58a21 100644 --- a/model/config.go +++ b/model/config.go @@ -208,6 +208,7 @@ type LdapSettings struct { // Advanced SkipCertificateVerification *bool QueryTimeout *int + MaxPageSize *int // Customization LoginFieldName *string @@ -526,6 +527,11 @@ func (o *Config) SetDefaults() { *o.LdapSettings.QueryTimeout = 60 } + if o.LdapSettings.MaxPageSize == nil { + o.LdapSettings.MaxPageSize = new(int) + *o.LdapSettings.MaxPageSize = 0 + } + if o.LdapSettings.LoginFieldName == nil { o.LdapSettings.LoginFieldName = new(string) *o.LdapSettings.LoginFieldName = "" @@ -724,6 +730,10 @@ func (o *Config) IsValid() *AppError { return NewLocAppError("Config.IsValid", "model.config.is_valid.ldap_sync_interval.app_error", nil, "") } + if *o.LdapSettings.MaxPageSize < 0 { + return NewLocAppError("Config.IsValid", "model.config.is_valid.ldap_max_page_size.app_error", nil, "") + } + if *o.LdapSettings.Enable { if *o.LdapSettings.LdapServer == "" || *o.LdapSettings.BaseDN == "" || -- cgit v1.2.3-1-g7c22