Merge pull request #832 from wemeya/api

modify ldap filter
This commit is contained in:
Daniel Jiang 2016-09-22 15:56:36 +08:00 committed by GitHub
commit 9b0cb3db05

View File

@ -77,7 +77,7 @@ func (l *Auth) Authenticate(m models.AuthModel) (*models.User, error) {
attrName := os.Getenv("LDAP_UID")
filter := os.Getenv("LDAP_FILTER")
if filter != "" {
filter = "(&(" + filter + ")(" + attrName + "=" + m.Principal + "))"
filter = "(&" + filter + "(" + attrName + "=" + m.Principal + "))"
} else {
filter = "(" + attrName + "=" + m.Principal + ")"
}