Adding page size option to LDAP (#3439)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
0cdc242cfd
Коммит
5dfa4fb629
@@ -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 == "" ||
|
||||
|
||||
Ссылка в новой задаче
Block a user