summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-07-04 07:04:02 -0400
committerJoram Wilander <jwawilander@gmail.com>2016-07-04 07:04:02 -0400
commit5dfa4fb62979ab9d4eba3c33a29397fe10f7cbc3 (patch)
treee183fbb3bf035f8998143f0e6021aa0eb3409045 /model
parent0cdc242cfdbc01d2dfb7315534e7ab34a5559beb (diff)
downloadchat-5dfa4fb62979ab9d4eba3c33a29397fe10f7cbc3.tar.gz
chat-5dfa4fb62979ab9d4eba3c33a29397fe10f7cbc3.tar.bz2
chat-5dfa4fb62979ab9d4eba3c33a29397fe10f7cbc3.zip
Adding page size option to LDAP (#3439)
Diffstat (limited to 'model')
-rw-r--r--model/config.go10
1 files changed, 10 insertions, 0 deletions
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 == "" ||