From 065570513d9218e5d5d05059d87ad1001b84bca7 Mon Sep 17 00:00:00 2001 From: Minho Date: Mon, 5 Feb 2018 13:41:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/account.go | 1 + mail/smtp.go | 14 +++++++++++--- views/account/find_password_setp1.tpl | 6 +++--- views/account/find_password_setp2.tpl | 10 +++++----- views/account/login.tpl | 4 ++-- views/account/mail_template.tpl | 5 ++--- views/book/dashboard.tpl | 2 +- views/book/index.tpl | 2 +- views/book/setting.tpl | 2 +- views/book/users.tpl | 4 ++-- views/document/compare.tpl | 2 +- views/errors/403.tpl | 2 +- views/errors/404.tpl | 2 +- views/errors/error.tpl | 2 +- views/manager/attach_detailed.tpl | 2 +- views/manager/edit_book.tpl | 2 +- views/manager/edit_users.tpl | 4 ++-- views/manager/index.tpl | 2 +- views/manager/setting.tpl | 4 ++-- views/manager/users.tpl | 10 +++++----- views/search/index.tpl | 2 +- views/setting/password.tpl | 2 +- 22 files changed, 47 insertions(+), 39 deletions(-) diff --git a/controllers/account.go b/controllers/account.go index 88d54284..2df3d192 100644 --- a/controllers/account.go +++ b/controllers/account.go @@ -246,6 +246,7 @@ func (c *AccountController) FindPassword() { data := map[string]interface{}{ "SITE_NAME": c.Option["SITE_NAME"], "url": c.BaseUrl() + beego.URLFor("AccountController.FindPassword", "token", member_token.Token, "mail", email), + "BaseUrl": c.BaseUrl(), } body, err := c.ExecuteViewPathTemplate("account/mail_template.tpl", data) diff --git a/mail/smtp.go b/mail/smtp.go index 423b3a8b..9caef12f 100644 --- a/mail/smtp.go +++ b/mail/smtp.go @@ -17,6 +17,7 @@ import ( "regexp" "strconv" "strings" + "github.com/astaxie/beego" ) var ( @@ -85,8 +86,8 @@ func (s *SMTPConfig) Auth() smtp.Auth { case "SSL": fallthrough default: - auth = smtp.PlainAuth(s.Identity, s.Username, s.Password, s.Host) - //auth = unencryptedAuth{smtp.PlainAuth(s.Identity, s.Username, s.Password, s.Host)} + //auth = smtp.PlainAuth(s.Identity, s.Username, s.Password, s.Host) + auth = unencryptedAuth{smtp.PlainAuth(s.Identity, s.Username, s.Password, s.Host)} } return auth } @@ -234,13 +235,20 @@ func (c *SMTPClient) SendTLS(m Mail, message bytes.Buffer) error { log.Println(err) return err } + + //if err := ct.StartTLS(tlsconfig);err != nil { + // log.Println("StartTLS Error:",err,c.host,c.port) + // return err + //} + //if err := ct.StartTLS(tlsconfig);err != nil { // fmt.Println(err) // return err //} fmt.Println(c.smtpAuth) - if ok,_ := ct.Extension("AUTH"); ok { + if ok,s := ct.Extension("AUTH"); ok { + beego.Info(s) // Auth if err = ct.Auth(c.smtpAuth); err != nil { log.Println("Auth Error:", diff --git a/views/account/find_password_setp1.tpl b/views/account/find_password_setp1.tpl index 3bea34b0..78c733de 100644 --- a/views/account/find_password_setp1.tpl +++ b/views/account/find_password_setp1.tpl @@ -2,7 +2,7 @@ - + @@ -12,7 +12,7 @@ - + - + - - - + + + - - - - + + + + +