Browse Source

Merge branch 'ldap-2022Feb19' of tmp/arozos into master

TC 3 years ago
parent
commit
b94dacae57
2 changed files with 4 additions and 4 deletions
  1. 2 2
      mod/auth/ldap/ldapreader/reader.go
  2. 2 2
      startup.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) {

+ 2 - 2
startup.go

@@ -42,7 +42,6 @@ func RunStartup() {
 	UserSystemInit()        //See user.go
 	permissionInit()        //Register permission interface after user
 	RegisterSystemInit()    //See register.go
-	OAuthInit()             //Oauth system init
 	GroupStoragePoolInit()  //Register permission groups's storage pool, require permissionInit()
 	BridgeStoragePoolInit() //Register the bridged storage pool based on mounted storage pools
 
@@ -88,7 +87,8 @@ func RunStartup() {
 	mediaServer_init()
 	security_init()
 	backup_init()
-	ldapInit() //LDAP system init
+	OAuthInit() //Oauth system init
+	ldapInit()  //LDAP system init
 
 	//Start High Level Services that requires full arozos architectures
 	FTPServerInit() //Start FTP Server Endpoints