From 06174482826e81fb7c4675efff092e2986c4dac0 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Thu, 10 Sep 2015 17:11:41 -0400 Subject: finish new add auth UI --- models/login.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'models/login.go') diff --git a/models/login.go b/models/login.go index 527b763d..abd4fc03 100644 --- a/models/login.go +++ b/models/login.go @@ -39,7 +39,7 @@ var ( ErrAuthenticationUserUsed = errors.New("Authentication has been used by some users") ) -var LoginTypes = map[LoginType]string{ +var LoginNames = map[LoginType]string{ LDAP: "LDAP (via BindDN)", DLDAP: "LDAP (simple auth)", SMTP: "SMTP", @@ -118,8 +118,8 @@ func (source *LoginSource) BeforeSet(colName string, val xorm.Cell) { } } -func (source *LoginSource) TypeString() string { - return LoginTypes[source.Type] +func (source *LoginSource) TypeName() string { + return LoginNames[source.Type] } func (source *LoginSource) LDAP() *LDAPConfig { @@ -315,9 +315,7 @@ const ( SMTP_LOGIN = "LOGIN" ) -var ( - SMTPAuths = []string{SMTP_PLAIN, SMTP_LOGIN} -) +var SMTPAuths = []string{SMTP_PLAIN, SMTP_LOGIN} func SMTPAuth(a smtp.Auth, cfg *SMTPConfig) error { c, err := smtp.Dial(fmt.Sprintf("%s:%d", cfg.Host, cfg.Port)) -- cgit v1.2.3