Browse Source

Update reader.go

AY's Macbook Pro 3 năm trước cách đây
mục cha
commit
c0ee7bf2b8
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      mod/auth/ldap/ldapreader/reader.go

+ 2 - 2
mod/auth/ldap/ldapreader/reader.go

@@ -28,7 +28,7 @@ func NewLDAPReader(username string, password string, server string, basedn strin
 }
 
 func (handler *LdapReader) GetUser(username string) (*ldap.Entry, error) {
-	returnVal, err := handler.retrieveInformation("uid="+username+","+handler.basedn, "(objectClass=*)", ldap.ScopeBaseObject, handler.username, handler.password)
+	returnVal, err := handler.retrieveInformation("uid="+username+","+handler.basedn, "(objectClass=person)", ldap.ScopeBaseObject, handler.username, handler.password)
 	if err != nil {
 		return nil, err
 	}
@@ -39,7 +39,7 @@ func (handler *LdapReader) GetUser(username string) (*ldap.Entry, error) {
 }
 
 func (handler *LdapReader) GetAllUser() ([]*ldap.Entry, error) {
-	return handler.retrieveInformation(handler.basedn, "(objectClass=*)", ldap.ScopeWholeSubtree, handler.username, handler.password)
+	return handler.retrieveInformation(handler.basedn, "(objectClass=person)", ldap.ScopeWholeSubtree, handler.username, handler.password)
 }
 
 func (handler *LdapReader) Authenticate(username string, password string) (bool, error) {