mirror of https://github.com/portainer/portainer
feat(settings/ldap): preserve ReaderDN in database if empty in settings payload (#3537)
* Allows to avoid changing any current value when using LDAP Anonymous Modepull/3530/head
parent
6c492d2290
commit
f4c461d7fb
|
@ -69,11 +69,16 @@ func (handler *Handler) settingsUpdate(w http.ResponseWriter, r *http.Request) *
|
|||
}
|
||||
|
||||
if payload.LDAPSettings != nil {
|
||||
ldapReaderDN := settings.LDAPSettings.ReaderDN
|
||||
ldapPassword := settings.LDAPSettings.Password
|
||||
if payload.LDAPSettings.ReaderDN != "" {
|
||||
ldapReaderDN = payload.LDAPSettings.ReaderDN
|
||||
}
|
||||
if payload.LDAPSettings.Password != "" {
|
||||
ldapPassword = payload.LDAPSettings.Password
|
||||
}
|
||||
settings.LDAPSettings = *payload.LDAPSettings
|
||||
settings.LDAPSettings.ReaderDN = ldapReaderDN
|
||||
settings.LDAPSettings.Password = ldapPassword
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue