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

View File

@ -48,7 +48,6 @@ func (l LDAP) Connect() (*LDAPConn, error) {
}
}
type LDAPConn struct {
LDAP
connection *ldap.Conn
@ -125,6 +124,5 @@ func (l LDAPConn) ChangePassword(dn string, rawpassword string) error {
modify := ldap.NewModifyRequest(dn)
modify.Replace("userPassword", []string{"{CRYPT}" + hashedpasswd})
return l.connection.Modify(modify)
}

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{}{})

View File

@ -23,7 +23,6 @@ var myLDAP = LDAP{
BaseDN: "dc=example,dc=com",
}
type ResponseWriterPrefix struct {
real http.ResponseWriter
prefix string

View File

@ -6,7 +6,6 @@ import (
"strings"
)
func resetPassword(w http.ResponseWriter, r *http.Request) {
if len(r.URL.Query().Get("l")) == 0 || len(r.URL.Query().Get("t")) == 0 {
http.Redirect(w, r, "lost", http.StatusFound)