@ -28,25 +28,25 @@ type LoginType int 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					// Note: new type must append to the end of list to maintain compatibility.
  
					 
					 
					 
					// Note: new type must append to the end of list to maintain compatibility.
  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					const  (  
					 
					 
					 
					const  (  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						LoginNot ype  LoginType  =  iota   
					 
					 
					 
						LoginNoT ype  LoginType  =  iota   
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
						LoginPlain             // 1
   
					 
					 
					 
						LoginPlain             // 1
   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						LoginLdap               // 2
   
					 
					 
					 
						LoginLDAP               // 2
   
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
						LoginSmtp               // 3
   
					 
					 
					 
						LoginSMTP               // 3
   
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
						LoginPam                // 4
   
					 
					 
					 
						LoginPAM                // 4
   
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
						LoginDldap              // 5
   
					 
					 
					 
						LoginDLDAP              // 5
   
				
			 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					)  
					 
					 
					 
					)  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					var  LoginNames  =  map [ LoginType ] string {  
					 
					 
					 
					var  LoginNames  =  map [ LoginType ] string {  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						LoginLdap  :   "LDAP (via BindDN)" ,   
					 
					 
					 
						LoginLDAP  :   "LDAP (via BindDN)" ,   
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
						LoginDldap  :  "LDAP (simple auth)" ,  // Via direct bind
   
					 
					 
					 
						LoginDLDAP  :  "LDAP (simple auth)" ,  // Via direct bind
   
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
						LoginSmtp  :   "SMTP" ,   
					 
					 
					 
						LoginSMTP  :   "SMTP" ,   
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
						LoginPam  :    "PAM" ,   
					 
					 
					 
						LoginPAM  :    "PAM" ,   
				
			 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					}  
					 
					 
					 
					}  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					var  SecurityProtocolNames  =  map [ ldap . SecurityProtocol ] string {  
					 
					 
					 
					var  SecurityProtocolNames  =  map [ ldap . SecurityProtocol ] string {  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						ldap . SecurityProtocolUnencrypted :  "Unencrypted" ,   
					 
					 
					 
						ldap . SecurityProtocolUnencrypted :  "Unencrypted" ,   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						ldap . SecurityProtocolLdaps  :        "LDAPS" ,   
					 
					 
					 
						ldap . SecurityProtocolLDAPS  :        "LDAPS" ,   
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
						ldap . SecurityProtocolStartTls  :    "StartTLS" ,   
					 
					 
					 
						ldap . SecurityProtocolStartTLS  :    "StartTLS" ,   
				
			 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					}  
					 
					 
					 
					}  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					// Ensure structs implemented interface.
  
					 
					 
					 
					// Ensure structs implemented interface.
  
				
			 
			
		
	
	
		
		
			
				
					
						
							
								 
							 
						
						
							
								 
							 
						
						
					 
					 
					@ -139,11 +139,11 @@ func (source *LoginSource) BeforeSet(colName string, val xorm.Cell) { 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						switch  colName  {   
					 
					 
					 
						switch  colName  {   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						case  "type" :   
					 
					 
					 
						case  "type" :   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							switch  LoginType ( Cell2Int64 ( val ) )  {   
					 
					 
					 
							switch  LoginType ( Cell2Int64 ( val ) )  {   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							case  LoginLdap ,  LoginDldap  :   
					 
					 
					 
							case  LoginLDAP ,  LoginDLDAP  :   
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
								source . Cfg  =  new ( LDAPConfig )   
					 
					 
					 
								source . Cfg  =  new ( LDAPConfig )   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							case  LoginSmtp  :   
					 
					 
					 
							case  LoginSMTP  :   
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
								source . Cfg  =  new ( SMTPConfig )   
					 
					 
					 
								source . Cfg  =  new ( SMTPConfig )   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							case  LoginPam  :   
					 
					 
					 
							case  LoginPAM  :   
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
								source . Cfg  =  new ( PAMConfig )   
					 
					 
					 
								source . Cfg  =  new ( PAMConfig )   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							default :   
					 
					 
					 
							default :   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
								panic ( "unrecognized login source type: "  +  com . ToStr ( * val ) )   
					 
					 
					 
								panic ( "unrecognized login source type: "  +  com . ToStr ( * val ) )   
				
			 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
							 
						
					 
					 
					@ -165,19 +165,19 @@ func (source *LoginSource) TypeName() string { 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					}  
					 
					 
					 
					}  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					func  ( source  * LoginSource )  IsLDAP ( )  bool  {  
					 
					 
					 
					func  ( source  * LoginSource )  IsLDAP ( )  bool  {  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						return  source . Type  ==  LoginLdap    
					 
					 
					 
						return  source . Type  ==  LoginLDAP    
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					}  
					 
					 
					 
					}  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					func  ( source  * LoginSource )  IsDLDAP ( )  bool  {  
					 
					 
					 
					func  ( source  * LoginSource )  IsDLDAP ( )  bool  {  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						return  source . Type  ==  LoginDldap    
					 
					 
					 
						return  source . Type  ==  LoginDLDAP    
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					}  
					 
					 
					 
					}  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					func  ( source  * LoginSource )  IsSMTP ( )  bool  {  
					 
					 
					 
					func  ( source  * LoginSource )  IsSMTP ( )  bool  {  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						return  source . Type  ==  LoginSmtp    
					 
					 
					 
						return  source . Type  ==  LoginSMTP    
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					}  
					 
					 
					 
					}  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					func  ( source  * LoginSource )  IsPAM ( )  bool  {  
					 
					 
					 
					func  ( source  * LoginSource )  IsPAM ( )  bool  {  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						return  source . Type  ==  LoginPam    
					 
					 
					 
						return  source . Type  ==  LoginPAM    
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					}  
					 
					 
					 
					}  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					func  ( source  * LoginSource )  HasTLS ( )  bool  {  
					 
					 
					 
					func  ( source  * LoginSource )  HasTLS ( )  bool  {  
				
			 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
							 
						
					 
					 
					@ -188,9 +188,9 @@ func (source *LoginSource) HasTLS() bool { 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					func  ( source  * LoginSource )  UseTLS ( )  bool  {  
					 
					 
					 
					func  ( source  * LoginSource )  UseTLS ( )  bool  {  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						switch  source . Type  {   
					 
					 
					 
						switch  source . Type  {   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						case  LoginLdap ,  LoginDldap  :   
					 
					 
					 
						case  LoginLDAP ,  LoginDLDAP  :   
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
							return  source . LDAP ( ) . SecurityProtocol  !=  ldap . SecurityProtocolUnencrypted   
					 
					 
					 
							return  source . LDAP ( ) . SecurityProtocol  !=  ldap . SecurityProtocolUnencrypted   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						case  LoginSmtp  :   
					 
					 
					 
						case  LoginSMTP  :   
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
							return  source . SMTP ( ) . TLS   
					 
					 
					 
							return  source . SMTP ( ) . TLS   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						}   
					 
					 
					 
						}   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
							 
						
					 
					 
					@ -199,9 +199,9 @@ func (source *LoginSource) UseTLS() bool { 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					func  ( source  * LoginSource )  SkipVerify ( )  bool  {  
					 
					 
					 
					func  ( source  * LoginSource )  SkipVerify ( )  bool  {  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						switch  source . Type  {   
					 
					 
					 
						switch  source . Type  {   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						case  LoginLdap ,  LoginDldap  :   
					 
					 
					 
						case  LoginLDAP ,  LoginDLDAP  :   
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
							return  source . LDAP ( ) . SkipVerify   
					 
					 
					 
							return  source . LDAP ( ) . SkipVerify   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						case  LoginSmtp  :   
					 
					 
					 
						case  LoginSMTP  :   
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
							return  source . SMTP ( ) . SkipVerify   
					 
					 
					 
							return  source . SMTP ( ) . SkipVerify   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						}   
					 
					 
					 
						}   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
	
		
		
			
				
					
						
							
								 
							 
						
						
							
								 
							 
						
						
					 
					 
					@ -293,7 +293,7 @@ func composeFullName(firstname, surname, username string) string { 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					// LoginViaLDAP queries if login/password is valid against the LDAP directory pool,
  
					 
					 
					 
					// LoginViaLDAP queries if login/password is valid against the LDAP directory pool,
  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					// and create a local user if success when enabled.
  
					 
					 
					 
					// and create a local user if success when enabled.
  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					func  LoginViaLDAP ( user  * User ,  login ,  passowrd  string ,  source  * LoginSource ,  autoRegister  bool )  ( * User ,  error )  {  
					 
					 
					 
					func  LoginViaLDAP ( user  * User ,  login ,  passowrd  string ,  source  * LoginSource ,  autoRegister  bool )  ( * User ,  error )  {  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						username ,  fn ,  sn ,  mail ,  isAdmin ,  succeed  :=  source . Cfg . ( * LDAPConfig ) . SearchEntry ( login ,  passowrd ,  source . Type  ==  LoginDldap  )   
					 
					 
					 
						username ,  fn ,  sn ,  mail ,  isAdmin ,  succeed  :=  source . Cfg . ( * LDAPConfig ) . SearchEntry ( login ,  passowrd ,  source . Type  ==  LoginDLDAP  )   
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
						if  ! succeed  {   
					 
					 
					 
						if  ! succeed  {   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							// User not in LDAP, do nothing
   
					 
					 
					 
							// User not in LDAP, do nothing
   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							return  nil ,  ErrUserNotExist { 0 ,  login }   
					 
					 
					 
							return  nil ,  ErrUserNotExist { 0 ,  login }   
				
			 
			
		
	
	
		
		
			
				
					
						
							
								 
							 
						
						
							
								 
							 
						
						
					 
					 
					@ -358,11 +358,11 @@ func (auth *smtpLoginAuth) Next(fromServer []byte, more bool) ([]byte, error) { 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					}  
					 
					 
					 
					}  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					const  (  
					 
					 
					 
					const  (  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						Smtp Plain  =  "PLAIN"   
					 
					 
					 
						SMTP Plain  =  "PLAIN"   
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
						Smtp Login  =  "LOGIN"   
					 
					 
					 
						SMTP Login  =  "LOGIN"   
				
			 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					)  
					 
					 
					 
					)  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					var  SMTPAuths  =  [ ] string { SmtpPlain ,  Smtp Login }  
					 
					 
					 
					var  SMTPAuths  =  [ ] string { SMTPPlain ,  SMTP Login }  
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					func  SMTPAuth ( a  smtp . Auth ,  cfg  * SMTPConfig )  error  {  
					 
					 
					 
					func  SMTPAuth ( a  smtp . Auth ,  cfg  * SMTPConfig )  error  {  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						c ,  err  :=  smtp . Dial ( fmt . Sprintf ( "%s:%d" ,  cfg . Host ,  cfg . Port ) )   
					 
					 
					 
						c ,  err  :=  smtp . Dial ( fmt . Sprintf ( "%s:%d" ,  cfg . Host ,  cfg . Port ) )   
				
			 
			
		
	
	
		
		
			
				
					
						
							
								 
							 
						
						
							
								 
							 
						
						
					 
					 
					@ -411,9 +411,9 @@ func LoginViaSMTP(user *User, login, password string, sourceID int64, cfg *SMTPC 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						}   
					 
					 
					 
						}   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						var  auth  smtp . Auth   
					 
					 
					 
						var  auth  smtp . Auth   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						if  cfg . Auth  ==  Smtp Plain  {   
					 
					 
					 
						if  cfg . Auth  ==  SMTP Plain  {   
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
							auth  =  smtp . PlainAuth ( "" ,  login ,  password ,  cfg . Host )   
					 
					 
					 
							auth  =  smtp . PlainAuth ( "" ,  login ,  password ,  cfg . Host )   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						}  else  if  cfg . Auth  ==  Smtp Login  {   
					 
					 
					 
						}  else  if  cfg . Auth  ==  SMTP Login  {   
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
							auth  =  & smtpLoginAuth { login ,  password }   
					 
					 
					 
							auth  =  & smtpLoginAuth { login ,  password }   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						}  else  {   
					 
					 
					 
						}  else  {   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							return  nil ,  errors . New ( "Unsupported SMTP auth type" )   
					 
					 
					 
							return  nil ,  errors . New ( "Unsupported SMTP auth type" )   
				
			 
			
		
	
	
		
		
			
				
					
						
							
								 
							 
						
						
							
								 
							 
						
						
					 
					 
					@ -445,7 +445,7 @@ func LoginViaSMTP(user *User, login, password string, sourceID int64, cfg *SMTPC 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							Name :         strings . ToLower ( username ) ,   
					 
					 
					 
							Name :         strings . ToLower ( username ) ,   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							Email :        login ,   
					 
					 
					 
							Email :        login ,   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							Passwd :       password ,   
					 
					 
					 
							Passwd :       password ,   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							LoginType :    LoginSmtp  ,   
					 
					 
					 
							LoginType :    LoginSMTP  ,   
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
							LoginSource :  sourceID ,   
					 
					 
					 
							LoginSource :  sourceID ,   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							LoginName :    login ,   
					 
					 
					 
							LoginName :    login ,   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							IsActive :     true ,   
					 
					 
					 
							IsActive :     true ,   
				
			 
			
		
	
	
		
		
			
				
					
						
							
								 
							 
						
						
							
								 
							 
						
						
					 
					 
					@ -479,7 +479,7 @@ func LoginViaPAM(user *User, login, password string, sourceID int64, cfg *PAMCon 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							Name :         login ,   
					 
					 
					 
							Name :         login ,   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							Email :        login ,   
					 
					 
					 
							Email :        login ,   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							Passwd :       password ,   
					 
					 
					 
							Passwd :       password ,   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							LoginType :    LoginPam  ,   
					 
					 
					 
							LoginType :    LoginPAM  ,   
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
							LoginSource :  sourceID ,   
					 
					 
					 
							LoginSource :  sourceID ,   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							LoginName :    login ,   
					 
					 
					 
							LoginName :    login ,   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							IsActive :     true ,   
					 
					 
					 
							IsActive :     true ,   
				
			 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
							 
						
					 
					 
					@ -493,11 +493,11 @@ func ExternalUserLogin(user *User, login, password string, source *LoginSource, 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						}   
					 
					 
					 
						}   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						switch  source . Type  {   
					 
					 
					 
						switch  source . Type  {   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						case  LoginLdap ,  LoginDldap  :   
					 
					 
					 
						case  LoginLDAP ,  LoginDLDAP  :   
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
							return  LoginViaLDAP ( user ,  login ,  password ,  source ,  autoRegister )   
					 
					 
					 
							return  LoginViaLDAP ( user ,  login ,  password ,  source ,  autoRegister )   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						case  LoginSmtp  :   
					 
					 
					 
						case  LoginSMTP  :   
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
							return  LoginViaSMTP ( user ,  login ,  password ,  source . ID ,  source . Cfg . ( * SMTPConfig ) ,  autoRegister )   
					 
					 
					 
							return  LoginViaSMTP ( user ,  login ,  password ,  source . ID ,  source . Cfg . ( * SMTPConfig ) ,  autoRegister )   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						case  LoginPam  :   
					 
					 
					 
						case  LoginPAM  :   
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
							return  LoginViaPAM ( user ,  login ,  password ,  source . ID ,  source . Cfg . ( * PAMConfig ) ,  autoRegister )   
					 
					 
					 
							return  LoginViaPAM ( user ,  login ,  password ,  source . ID ,  source . Cfg . ( * PAMConfig ) ,  autoRegister )   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						}   
					 
					 
					 
						}   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
							 
						
					 
					 
					@ -520,7 +520,7 @@ func UserSignIn(username, passowrd string) (*User, error) { 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						if  hasUser  {   
					 
					 
					 
						if  hasUser  {   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							switch  user . LoginType  {   
					 
					 
					 
							switch  user . LoginType  {   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							case  LoginNot ype ,  LoginPlain :   
					 
					 
					 
							case  LoginNoT ype ,  LoginPlain :   
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
								if  user . ValidatePassword ( passowrd )  {   
					 
					 
					 
								if  user . ValidatePassword ( passowrd )  {   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
									return  user ,  nil   
					 
					 
					 
									return  user ,  nil   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
								}   
					 
					 
					 
								}