minor improvements

This commit is contained in:
Christian Müller
2017-09-22 21:30:58 +00:00
parent 16a09e5036
commit fa158f485a
3 changed files with 2 additions and 3 deletions
+1 -1
View File
@@ -20,7 +20,7 @@
Accept <a href="/TOS.md">Terms of Service</a>
</label>
<div id="captcha" class="g-recaptcha" data-sitekey="6LemnDEUAAAAAC6A4VNRefz0BSLiC343W4sXQd6I"></div>
<input class="button ui-elem" disabled id="publish-button" name="button" type="submit" value="Publish" />
<input class="button ui-elem" disabled id="publish-button" name="button" type="submit" value="Publish Note" />
</fieldset>
</form>
<footer>
+1 -1
View File
@@ -10,7 +10,7 @@ func email(id, text string) error {
smtpServer := os.Getenv("SMTP_SERVER")
auth := smtp.PlainAuth("", os.Getenv("SMTP_USER"), os.Getenv("SMTP_PASSWORD"), smtpServer)
to := []string{os.Getenv("NOTEHUB_ADMIN_EMAIL")}
msg := []byte("Subject: note reported\r\n\r\n" +
msg := []byte("Subject: Note reported\r\n\r\n" +
fmt.Sprintf("Note https://notehub.org/%s was reported: %q\r\n", id, text))
return smtp.SendMail(smtpServer+":587", auth, to[0], to, msg)
}
-1
View File
@@ -107,7 +107,6 @@ func main() {
e.POST("/note", func(c echo.Context) error {
c.Logger().Debug("POST /note requested")
if !skipCaptcha && !checkRecaptcha(c, c.FormValue("g-recaptcha-response")) {
c.Logger().Warnf("captcha validation failed for %s", c.Request().RemoteAddr)
code := http.StatusForbidden
return c.Render(code, "Note", responsePage(code))
}