modify ldap filter

This commit is contained in:
wemeya 2016-09-22 15:23:55 +08:00
parent 9bbdbfa520
commit 1c09e1fc1c

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 + ")"
}