From 2009549f41abeabe017a20f681e04292a8be378e Mon Sep 17 00:00:00 2001 From: yinw Date: Mon, 29 Feb 2016 18:48:11 +0800 Subject: [PATCH] bug fix: 1.UI exits when ldap binds failed 2.make fields in templates match with go files after executing golint --- auth/ldap/ldap.go | 2 +- views/reset-password-mail.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/auth/ldap/ldap.go b/auth/ldap/ldap.go index 6316f5327..bc24cb8fe 100644 --- a/auth/ldap/ldap.go +++ b/auth/ldap/ldap.go @@ -57,7 +57,6 @@ func (l *Auth) Authenticate(m models.AuthModel) (*models.User, error) { if err != nil { return nil, err } - defer ldap.Close() ldap.SetOption(openldap.LDAP_OPT_PROTOCOL_VERSION, openldap.LDAP_VERSION3) @@ -73,6 +72,7 @@ func (l *Auth) Authenticate(m models.AuthModel) (*models.User, error) { if err != nil { return nil, err } + defer ldap.Close() scope := openldap.LDAP_SCOPE_SUBTREE // LDAP_SCOPE_BASE, LDAP_SCOPE_ONELEVEL, LDAP_SCOPE_SUBTREE filter := "objectClass=*" diff --git a/views/reset-password-mail.tpl b/views/reset-password-mail.tpl index e79cdfddb..1bc5370c0 100644 --- a/views/reset-password-mail.tpl +++ b/views/reset-password-mail.tpl @@ -16,6 +16,6 @@

{{.Hint}}:

- {{.Url}}/resetPassword?reset_uuid={{.Uuid}} + {{.URL}}/resetPassword?reset_uuid={{.UUID}} \ No newline at end of file