This commit is contained in:
Pierre-Olivier Mercier
2020-09-02 15:09:14 +02:00
parent f819320f5a
commit b8d9118b56
4 changed files with 11 additions and 16 deletions

View File

@@ -5,8 +5,8 @@ import (
"encoding/base64"
"encoding/binary"
"io"
"net/http"
"log"
"net/http"
"os"
"os/exec"
"time"
@@ -51,7 +51,6 @@ func (l LDAPConn) genToken(dn string, previous bool) string {
return base64.StdEncoding.EncodeToString(hash.Sum(nil)[:])
}
func lostPassword(w http.ResponseWriter, r *http.Request) {
if r.Method != "POST" {
displayTmpl(w, "lost.html", map[string]interface{}{})
@@ -115,7 +114,7 @@ func lostPassword(w http.ResponseWriter, r *http.Request) {
m.SetHeader("From", "noreply@nemunai.re")
m.SetHeader("To", email)
m.SetHeader("Subject", "SSO nemunai.re: password recovery")
m.SetBody("text/plain", "Hello " + cn + "!\n\nSomeone, and we hope it's you, requested to reset your account password. \nIn order to continue, go to:\nhttps://ldap.nemunai.re/reset?l=" + r.PostFormValue("login") + "&t=" + token + "\n\nBest regards,\n-- \nnemunai.re SSO")
m.SetBody("text/plain", "Hello "+cn+"!\n\nSomeone, and we hope it's you, requested to reset your account password. \nIn order to continue, go to:\nhttps://ldap.nemunai.re/reset?l="+r.PostFormValue("login")+"&t="+token+"\n\nBest regards,\n-- \nnemunai.re SSO")
// Using local sendmail: delegate to the local admin sys the responsability to transport the mail
s := gomail.SendFunc(func(from string, to []string, msg io.WriterTo) error {