go fmt
This commit is contained in:
parent
f819320f5a
commit
b8d9118b56
4 changed files with 11 additions and 16 deletions
2
ldap.go
2
ldap.go
|
@ -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)
|
||||
}
|
||||
|
|
3
lost.go
3
lost.go
|
@ -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{}{})
|
||||
|
|
1
main.go
1
main.go
|
@ -23,7 +23,6 @@ var myLDAP = LDAP{
|
|||
BaseDN: "dc=example,dc=com",
|
||||
}
|
||||
|
||||
|
||||
type ResponseWriterPrefix struct {
|
||||
real http.ResponseWriter
|
||||
prefix string
|
||||
|
|
1
reset.go
1
reset.go
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue