mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Fix type in unused constant name (#111)
* Write LDAP, SMTP, PAM, DLDAP back to all uppercase * Fix type in unused constant name * Other MixCased fixes * Complete MixerCasing of template constants * Re uppercase LTS and LDAPS suffixes * Uppercase JSON suffix in constant names * Proper case LoginNoType * Prefix unexported template path constants with "tpl"
This commit is contained in:
		
				
					committed by
					
						
						Andrey Nering
					
				
			
			
				
	
			
			
			
						parent
						
							c8c748aea6
						
					
				
				
					commit
					864d1b1f9f
				
			@@ -21,8 +21,8 @@ type SecurityProtocol int
 | 
			
		||||
// Note: new type must be added at the end of list to maintain compatibility.
 | 
			
		||||
const (
 | 
			
		||||
	SecurityProtocolUnencrypted SecurityProtocol = iota
 | 
			
		||||
	SecurityProtocolLdaps
 | 
			
		||||
	SecurityProtocolStartTls
 | 
			
		||||
	SecurityProtocolLDAPS
 | 
			
		||||
	SecurityProtocolStartTLS
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// Basic LDAP authentication service
 | 
			
		||||
@@ -118,7 +118,7 @@ func dial(ls *Source) (*ldap.Conn, error) {
 | 
			
		||||
		ServerName:         ls.Host,
 | 
			
		||||
		InsecureSkipVerify: ls.SkipVerify,
 | 
			
		||||
	}
 | 
			
		||||
	if ls.SecurityProtocol == SecurityProtocolLdaps {
 | 
			
		||||
	if ls.SecurityProtocol == SecurityProtocolLDAPS {
 | 
			
		||||
		return ldap.DialTLS("tcp", fmt.Sprintf("%s:%d", ls.Host, ls.Port), tlsCfg)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -127,7 +127,7 @@ func dial(ls *Source) (*ldap.Conn, error) {
 | 
			
		||||
		return nil, fmt.Errorf("Dial: %v", err)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if ls.SecurityProtocol == SecurityProtocolStartTls {
 | 
			
		||||
	if ls.SecurityProtocol == SecurityProtocolStartTLS {
 | 
			
		||||
		if err = conn.StartTLS(tlsCfg); err != nil {
 | 
			
		||||
			conn.Close()
 | 
			
		||||
			return nil, fmt.Errorf("StartTLS: %v", err)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user