mirror of
				https://gitlab.crans.org/nounous/ghostream.git
				synced 2025-11-04 11:12:17 +01:00 
			
		
		
		
	Log the LDAP connection
This commit is contained in:
		@@ -42,8 +42,10 @@ func (a LDAP) Login(username string, password string) (bool, string, error) {
 | 
			
		||||
	for _, username := range potentialUsernames {
 | 
			
		||||
		// Try to bind as user
 | 
			
		||||
		bindDn := "cn=" + username + "," + a.Cfg.UserDn
 | 
			
		||||
		log.Printf("[LDAP] Logging to %s...", bindDn)
 | 
			
		||||
		err = a.Conn.Bind(bindDn, password)
 | 
			
		||||
		if err == nil {
 | 
			
		||||
			log.Printf("[LDAP] Logging failed: %s", err)
 | 
			
		||||
			// Login succeeded if no error
 | 
			
		||||
			return true, aliasSplit[0], nil
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user