summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
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 == "" ||