Remove dup call to createGroupSearchFilter in searchGroup

Signed-off-by: stonezdj <stonezdj@gmail.com>
This commit is contained in:
stonezdj 2020-10-20 19:07:33 +08:00
parent 73981062a9
commit ca7258617b

View File

@ -371,11 +371,7 @@ func (session *Session) SearchGroupByDN(groupDN string) ([]models.LdapGroup, err
if _, err := goldap.ParseDN(groupDN); err != nil { if _, err := goldap.ParseDN(groupDN); err != nil {
return nil, ErrDNSyntax return nil, ErrDNSyntax
} }
ldapFilter, err := createGroupSearchFilter(session.ldapGroupConfig.LdapGroupFilter, "", session.ldapGroupConfig.LdapGroupNameAttribute) groupList, err := session.searchGroup(groupDN, session.ldapGroupConfig.LdapGroupFilter, "", session.ldapGroupConfig.LdapGroupNameAttribute)
if err != nil {
return nil, err
}
groupList, err := session.searchGroup(groupDN, ldapFilter, "", session.ldapGroupConfig.LdapGroupNameAttribute)
if serverError, ok := err.(*goldap.Error); ok { if serverError, ok := err.(*goldap.Error); ok {
log.Debugf("resultCode:%v", serverError.ResultCode) log.Debugf("resultCode:%v", serverError.ResultCode)
} }