diff --git a/account.go b/account.go index e88c1fd..0c83ad4 100644 --- a/account.go +++ b/account.go @@ -1278,18 +1278,20 @@ func viewResetPassword(app *App, w http.ResponseWriter, r *http.Request) error { // Show reset password page d := struct { page.StaticPage - Flashes []string - CSRFField template.HTML - Token string - IsResetting bool - IsSent bool + Flashes []string + EmailEnabled bool + CSRFField template.HTML + Token string + IsResetting bool + IsSent bool }{ - StaticPage: pageForReq(app, r), - Flashes: f, - CSRFField: csrf.TemplateField(r), - Token: token, - IsResetting: resetting, - IsSent: r.FormValue("sent") == "1", + StaticPage: pageForReq(app, r), + Flashes: f, + EmailEnabled: app.cfg.Email.Enabled(), + CSRFField: csrf.TemplateField(r), + Token: token, + IsResetting: resetting, + IsSent: r.FormValue("sent") == "1", } err := pages["reset.tmpl"].ExecuteTemplate(w, "base", d) if err != nil { diff --git a/pages/reset.tmpl b/pages/reset.tmpl index 6deac41..3db2418 100644 --- a/pages/reset.tmpl +++ b/pages/reset.tmpl @@ -14,6 +14,11 @@ label {

Reset your password

+{{ if not .EmailEnabled }} +
+

Email is not configured on this server! Please contact your admin to reset your password.

+
+{{ else }} {{if .Flashes}}{{end}} @@ -26,7 +31,7 @@ label { - {{ .CSRFField }} + {{ .CSRFField }} {{else if not .IsSent}}
@@ -39,10 +44,11 @@ label {
{{end}} - + +{{ end }} {{end}}